Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 352
First PR - Implements the Opentracing API#2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
c0a0b6d8c242adfdd653dc9c53c97ee51d0580a0d27f0a2d6a8535a0af244a01a981bbc769fa669ea857299cc578b66116df1c5280399cb0638f3031955dcdee9f912c9abfa64dd11b57e38848dae7e56588cfef52626f909c0cbbef6dccc445e9da352e10e81656a2a3b1d247e7700fbc8395d0663d345c089cf99977a0185248911378541626562d364d10b6632eecf5f2543481439fd840aba6bcea95846f45f76da5db36a0f52273454628f2eba30b13f412cf7e49d7771403e3406ef772bdf4e0eb6af3f61abdbfffbebf81502e7ed0e165cd09a95af8f97952297f7ed4ad8ad68538f708944b29dc6391ea3b8517e8409dada38ee29edf3b75a53987ade30f5b9e2a9fd5e434471698b6c8cfb2751508804dec780b3fa20e3c9ea5c09e9e525772e9696aa6ac37031ff14cc2b461d388dd61ca5fdFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,156 +1,34 @@ | ||
| # Maven # | ||
| ######### | ||
| target | ||
| # Created by https://www.gitignore.io/api/java,maven,eclipse,intellij | ||
| ### Eclipse ### | ||
| .metadata | ||
| bin/ | ||
| tmp/ | ||
| *.tmp | ||
| *.bak | ||
| *.swp | ||
| *~.nib | ||
| local.properties | ||
| .settings/ | ||
| .loadpath | ||
| .recommenders | ||
| # External tool builders | ||
| .externalToolBuilders/ | ||
| # Locally stored "Eclipse launch configurations" | ||
| # Eclipse # | ||
| ########### | ||
| *.launch | ||
| # PyDev specific (Python IDE for Eclipse) | ||
| *.pydevproject | ||
| # CDT-specific (C/C++ Development Tooling) | ||
| .cproject | ||
| # Java annotation processor (APT) | ||
| .factorypath | ||
| # PDT-specific (PHP Development Tools) | ||
| .buildpath | ||
| # sbteclipse plugin | ||
| .target | ||
| # Tern plugin | ||
| .tern-project | ||
| # TeXlipse plugin | ||
| .texlipse | ||
| # STS (Spring Tool Suite) | ||
| .springBeans | ||
| # Code Recommenders | ||
| .recommenders/ | ||
| # Scala IDE specific (Scala & Java development for Eclipse) | ||
| .cache-main | ||
| .scala_dependencies | ||
| .worksheet | ||
| ### Intellij ### | ||
| # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
| # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
| # User-specific stuff: | ||
| .idea/**/workspace.xml | ||
| .idea/**/tasks.xml | ||
| .idea/dictionaries | ||
| # Sensitive or high-churn files: | ||
| .idea/**/dataSources/ | ||
| .idea/**/dataSources.ids | ||
| .idea/**/dataSources.xml | ||
| .idea/**/dataSources.local.xml | ||
| .idea/**/sqlDataSources.xml | ||
| .idea/**/dynamic.xml | ||
| .idea/**/uiDesigner.xml | ||
| # Gradle: | ||
| .idea/**/gradle.xml | ||
| .idea/**/libraries | ||
| # CMake | ||
| cmake-build-debug/ | ||
| # Mongo Explorer plugin: | ||
| .idea/**/mongoSettings.xml | ||
| ## File-based project format: | ||
| *.iws | ||
| ## Plugin-specific files: | ||
| # IntelliJ | ||
| /out/ | ||
| # mpeltonen/sbt-idea plugin | ||
| .idea_modules/ | ||
| # JIRA plugin | ||
| atlassian-ide-plugin.xml | ||
| # Cursive Clojure plugin | ||
| .idea/replstate.xml | ||
| # Crashlytics plugin (for Android Studio and IntelliJ) | ||
| com_crashlytics_export_strings.xml | ||
| crashlytics.properties | ||
| crashlytics-build.properties | ||
| fabric.properties | ||
| ### Intellij Patch ### | ||
| # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 | ||
| # *.iml | ||
| # modules.xml | ||
| # .idea/misc.xml | ||
| # *.ipr | ||
| # Sonarlint plugin | ||
| .idea/sonarlint | ||
| ### Java ### | ||
| # Compiled class file | ||
| *.class | ||
| # Log file | ||
| *.log | ||
| # BlueJ files | ||
| *.ctxt | ||
| # Mobile Tools for Java (J2ME) | ||
| .mtj.tmp/ | ||
| # Package Files # | ||
| *.jar | ||
| *.war | ||
| *.ear | ||
| *.zip | ||
| *.tar.gz | ||
| *.rar | ||
| # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
| hs_err_pid* | ||
| ### Maven ### | ||
| target/ | ||
| pom.xml.tag | ||
| pom.xml.releaseBackup | ||
| pom.xml.versionsBackup | ||
| pom.xml.next | ||
| release.properties | ||
| dependency-reduced-pom.xml | ||
| buildNumber.properties | ||
| .mvn/timing.properties | ||
| # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) | ||
| !/.mvn/wrapper/maven-wrapper.jar | ||
| # End of https://www.gitignore.io/api/java,maven,eclipse,intellij | ||
| .settings | ||
| .project | ||
| .classpath | ||
| # OS generated files # | ||
| ###################### | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| Icon? | ||
| ehthumbs.db | ||
| Thumbs.db | ||
| # Intellij Idea # | ||
| ################# | ||
| /.idea | ||
| *.iml | ||
| # Visual Studio Code # | ||
| ###################### | ||
| .vscode | ||
| # Others # | ||
| ########## | ||
| /logs/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <groupId>com.datadog</groupId> | ||
| <artifactId>raclette-java</artifactId> | ||
| <version>1.0-SNAPSHOT</version> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>io.opentracing</groupId> | ||
| <artifactId>opentracing-api</artifactId> | ||
| <version>0.21.0</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-databind</artifactId> | ||
| <version>2.8.8</version> | ||
| </dependency> | ||
| <!-- Logging dependencies --> | ||
| <dependency> | ||
| <groupId>org.slf4j</groupId> | ||
| <artifactId>slf4j-api</artifactId> | ||
| <version>1.7.25</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-classic</artifactId> | ||
| <version>1.2.3</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>net.logstash.logback</groupId> | ||
| <artifactId>logstash-logback-encoder</artifactId> | ||
| <version>4.9</version> | ||
| </dependency> | ||
| <!-- Testing dependencies --> | ||
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <version>4.12</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-core</artifactId> | ||
| <version>3.6.2</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.mockito</groupId> | ||
| <artifactId>mockito-core</artifactId> | ||
| <version>2.7.22</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <configuration> | ||
| <source>1.6</source> | ||
| <target>1.6</target> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.datadoghq.trace; | ||
| import io.opentracing.Span; | ||
| /** | ||
| * Main interface to sample a collection of traces. | ||
| */ | ||
| public interface Sampler { | ||
| /** | ||
| * Sample a collection of traces based on the parent span | ||
| * | ||
| * @param span the parent span with its context | ||
| * @return true when the trace/spans has to be reported/written | ||
| */ | ||
| boolean sample(Span span); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package com.datadoghq.trace; | ||
| import java.util.List; | ||
| import io.opentracing.Span; | ||
| /** | ||
| * A writer is responsible to send collected spans to some place | ||
| */ | ||
| public interface Writer { | ||
| /** | ||
| * Write a trace represented by the entire list of all the finished spans | ||
| * | ||
| * @param trace the list of spans to write | ||
| */ | ||
| void write(List<Span> trace); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is order important? If not, this should probably be a Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No unfortunately we send List<List> (or list of traces if you prefer) to the writer ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @renaudboutet not sure that the order is so important. We just have to send an array of span. A collection should be fine | ||
| /** | ||
| * Indicates to the writer that no future writing will come and it should terminates all connections and tasks | ||
| */ | ||
| void close(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.datadoghq.trace.impl; | ||
| import com.datadoghq.trace.Sampler; | ||
| import io.opentracing.Span; | ||
| /** | ||
| * Sampler that always says yes... | ||
| */ | ||
| public class AllSampler implements Sampler { | ||
| @Override | ||
| public boolean sample(Span span) { | ||
| return true; | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably in test scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed