Skip to content

Commit 5f13cdb

Browse files
author
Guillaume Polaert
authored
Merge pull request #2 from DataDog/dev
+1 @renaudboutet
2 parents c8659e4 + 61ca5fd commit 5f13cdb

22 files changed

+1958
-154
lines changed

.gitignore

+32-154
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,34 @@
1+
# Maven #
2+
#########
3+
target
14

2-
# Created by https://www.gitignore.io/api/java,maven,eclipse,intellij
3-
4-
### Eclipse ###
5-
6-
.metadata
7-
bin/
8-
tmp/
9-
*.tmp
10-
*.bak
11-
*.swp
12-
*~.nib
13-
local.properties
14-
.settings/
15-
.loadpath
16-
.recommenders
17-
18-
# External tool builders
19-
.externalToolBuilders/
20-
21-
# Locally stored "Eclipse launch configurations"
5+
# Eclipse #
6+
###########
227
*.launch
23-
24-
# PyDev specific (Python IDE for Eclipse)
25-
*.pydevproject
26-
27-
# CDT-specific (C/C++ Development Tooling)
28-
.cproject
29-
30-
# Java annotation processor (APT)
31-
.factorypath
32-
33-
# PDT-specific (PHP Development Tools)
34-
.buildpath
35-
36-
# sbteclipse plugin
37-
.target
38-
39-
# Tern plugin
40-
.tern-project
41-
42-
# TeXlipse plugin
43-
.texlipse
44-
45-
# STS (Spring Tool Suite)
46-
.springBeans
47-
48-
# Code Recommenders
49-
.recommenders/
50-
51-
# Scala IDE specific (Scala & Java development for Eclipse)
52-
.cache-main
53-
.scala_dependencies
54-
.worksheet
55-
56-
### Intellij ###
57-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
58-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
59-
60-
# User-specific stuff:
61-
.idea/**/workspace.xml
62-
.idea/**/tasks.xml
63-
.idea/dictionaries
64-
65-
# Sensitive or high-churn files:
66-
.idea/**/dataSources/
67-
.idea/**/dataSources.ids
68-
.idea/**/dataSources.xml
69-
.idea/**/dataSources.local.xml
70-
.idea/**/sqlDataSources.xml
71-
.idea/**/dynamic.xml
72-
.idea/**/uiDesigner.xml
73-
74-
# Gradle:
75-
.idea/**/gradle.xml
76-
.idea/**/libraries
77-
78-
# CMake
79-
cmake-build-debug/
80-
81-
# Mongo Explorer plugin:
82-
.idea/**/mongoSettings.xml
83-
84-
## File-based project format:
85-
*.iws
86-
87-
## Plugin-specific files:
88-
89-
# IntelliJ
90-
/out/
91-
92-
# mpeltonen/sbt-idea plugin
93-
.idea_modules/
94-
95-
# JIRA plugin
96-
atlassian-ide-plugin.xml
97-
98-
# Cursive Clojure plugin
99-
.idea/replstate.xml
100-
101-
# Crashlytics plugin (for Android Studio and IntelliJ)
102-
com_crashlytics_export_strings.xml
103-
crashlytics.properties
104-
crashlytics-build.properties
105-
fabric.properties
106-
107-
### Intellij Patch ###
108-
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
109-
110-
# *.iml
111-
# modules.xml
112-
# .idea/misc.xml
113-
# *.ipr
114-
115-
# Sonarlint plugin
116-
.idea/sonarlint
117-
118-
### Java ###
119-
# Compiled class file
120-
*.class
121-
122-
# Log file
123-
*.log
124-
125-
# BlueJ files
126-
*.ctxt
127-
128-
# Mobile Tools for Java (J2ME)
129-
.mtj.tmp/
130-
131-
# Package Files #
132-
*.jar
133-
*.war
134-
*.ear
135-
*.zip
136-
*.tar.gz
137-
*.rar
138-
139-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
140-
hs_err_pid*
141-
142-
### Maven ###
143-
target/
144-
pom.xml.tag
145-
pom.xml.releaseBackup
146-
pom.xml.versionsBackup
147-
pom.xml.next
148-
release.properties
149-
dependency-reduced-pom.xml
150-
buildNumber.properties
151-
.mvn/timing.properties
152-
153-
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
154-
!/.mvn/wrapper/maven-wrapper.jar
155-
156-
# End of https://www.gitignore.io/api/java,maven,eclipse,intellij
8+
.settings
9+
.project
10+
.classpath
11+
12+
# OS generated files #
13+
######################
14+
.DS_Store
15+
.DS_Store?
16+
._*
17+
.Spotlight-V100
18+
.Trashes
19+
Icon?
20+
ehthumbs.db
21+
Thumbs.db
22+
23+
# Intellij Idea #
24+
#################
25+
/.idea
26+
*.iml
27+
28+
# Visual Studio Code #
29+
######################
30+
.vscode
31+
32+
# Others #
33+
##########
34+
/logs/*

pom.xml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.datadog</groupId>
7+
<artifactId>raclette-java</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
10+
<dependencies>
11+
<dependency>
12+
<groupId>io.opentracing</groupId>
13+
<artifactId>opentracing-api</artifactId>
14+
<version>0.21.0</version>
15+
</dependency>
16+
<dependency>
17+
<groupId>com.fasterxml.jackson.core</groupId>
18+
<artifactId>jackson-databind</artifactId>
19+
<version>2.8.8</version>
20+
</dependency>
21+
22+
<!-- Logging dependencies -->
23+
<dependency>
24+
<groupId>org.slf4j</groupId>
25+
<artifactId>slf4j-api</artifactId>
26+
<version>1.7.25</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>ch.qos.logback</groupId>
30+
<artifactId>logback-classic</artifactId>
31+
<version>1.2.3</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>net.logstash.logback</groupId>
35+
<artifactId>logstash-logback-encoder</artifactId>
36+
<version>4.9</version>
37+
</dependency>
38+
39+
<!-- Testing dependencies -->
40+
<dependency>
41+
<groupId>junit</groupId>
42+
<artifactId>junit</artifactId>
43+
<version>4.12</version>
44+
<scope>test</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.assertj</groupId>
48+
<artifactId>assertj-core</artifactId>
49+
<version>3.6.2</version>
50+
<scope>test</scope>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.mockito</groupId>
54+
<artifactId>mockito-core</artifactId>
55+
<version>2.7.22</version>
56+
<scope>test</scope>
57+
</dependency>
58+
</dependencies>
59+
60+
<build>
61+
<plugins>
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-compiler-plugin</artifactId>
65+
<configuration>
66+
<source>1.6</source>
67+
<target>1.6</target>
68+
</configuration>
69+
</plugin>
70+
</plugins>
71+
</build>
72+
73+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.datadoghq.trace;
2+
3+
4+
import io.opentracing.Span;
5+
6+
/**
7+
* Main interface to sample a collection of traces.
8+
*/
9+
public interface Sampler {
10+
11+
/**
12+
* Sample a collection of traces based on the parent span
13+
*
14+
* @param span the parent span with its context
15+
* @return true when the trace/spans has to be reported/written
16+
*/
17+
boolean sample(Span span);
18+
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.datadoghq.trace;
2+
3+
import java.util.List;
4+
5+
import io.opentracing.Span;
6+
7+
/**
8+
* A writer is responsible to send collected spans to some place
9+
*/
10+
public interface Writer {
11+
12+
/**
13+
* Write a trace represented by the entire list of all the finished spans
14+
*
15+
* @param trace the list of spans to write
16+
*/
17+
void write(List<Span> trace);
18+
19+
/**
20+
* Indicates to the writer that no future writing will come and it should terminates all connections and tasks
21+
*/
22+
void close();
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.datadoghq.trace.impl;
2+
3+
import com.datadoghq.trace.Sampler;
4+
import io.opentracing.Span;
5+
6+
/**
7+
* Sampler that always says yes...
8+
*/
9+
public class AllSampler implements Sampler {
10+
11+
@Override
12+
public boolean sample(Span span) {
13+
return true;
14+
}
15+
16+
}

0 commit comments

Comments
 (0)