-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[CURATOR-695] Open Telemetry tracing #494
base: master
Are you sure you want to change the base?
Changes from all commits
ed67ad6
e83197f
6081622
be1a37e
ea04dc1
111f3a6
74ff333
4210bd7
2f1fc4e
a18755a
ade9b7a
146aba0
761a794
2c2ef4c
1a8227d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,43 @@ | |
*/ | ||
public abstract class AdvancedTracerDriver implements TracerDriver { | ||
/** | ||
* Record the given trace event | ||
* Records the start of a new operation that will later complete successfully or erroneously via a call to | ||
* {@link #endTrace(OperationTrace)}. The call may optionally return driver specific state which can be | ||
* accessed in {@link #endTrace(OperationTrace) endTrace} via {@link OperationTrace#getDriverTrace()}. The | ||
* driver implementation is responsible for checking that any state returned is valid. Additionally, while it is | ||
* expected that all calls to {@code startTrace} will have a corresponding call to | ||
* {@link #endTrace(OperationTrace) endTrace}, it is the responsibility of the driver implementation to manage any | ||
* leaking of non-terminal {@link OperationTrace OperationTraces}. | ||
* | ||
* @param trace the metrics of the operation | ||
* @return The internal trace representation of the driver implementation. Driver dependent, may be {@code null}. | ||
*/ | ||
public abstract void addTrace(OperationTrace trace); | ||
public abstract Object startTrace(OperationTrace 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. It would be better to introduce a new sub-class/sub-interface of |
||
|
||
/** | ||
* Add to a named counter | ||
* Signals the completion, successful or otherwise, of the specified {@link OperationTrace}. | ||
* | ||
* @param trace the metrics of the operation | ||
*/ | ||
public abstract void endTrace(OperationTrace trace); | ||
|
||
/** | ||
* Record the given trace event after the completion of the event. This is equivalent to calling | ||
* {@link #startTrace(OperationTrace) startTrace} followed by {@link #endTrace(OperationTrace) endTrace}. | ||
* | ||
* @param trace the metrics of the operation | ||
* @deprecated Prefer the use of {@link #startTrace(OperationTrace)} followed by {@link #endTrace(OperationTrace)} | ||
*/ | ||
@Deprecated | ||
public void addTrace(OperationTrace trace) { | ||
startTrace(trace); | ||
endTrace(trace); | ||
} | ||
|
||
/** | ||
* Record the given trace event | ||
* | ||
* @param name name of the counter | ||
* @param increment amount to increment | ||
* @param trace name of the counter | ||
*/ | ||
public abstract void addEvent(EventTrace trace); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
|
||
--> | ||
|
||
<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> | ||
|
||
<parent> | ||
<groupId>org.apache.curator</groupId> | ||
<artifactId>curator-drivers</artifactId> | ||
<version>5.6.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>curator-drivers-open-telemetry</artifactId> | ||
<version>5.6.1-SNAPSHOT</version> | ||
|
||
<name>Curator OpenTelemetry Tracing Driver</name> | ||
<description>A tracing driver driver that emits OpenTelemetry spans.</description> | ||
<inceptionYear>2023</inceptionYear> | ||
|
||
<properties> | ||
<opentelemetry.version>1.31.0</opentelemetry.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.curator</groupId> | ||
<artifactId>curator-client</artifactId> | ||
<version>${project.version}</version> | ||
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. This should be at scope 'provided' |
||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.opentelemetry</groupId> | ||
<artifactId>opentelemetry-api</artifactId> | ||
<version>${opentelemetry.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.opentelemetry</groupId> | ||
<artifactId>opentelemetry-sdk-testing</artifactId> | ||
<version>${opentelemetry.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-log4j12</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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.
we should bump the version in a separate commit, can you please revert ?