-
Notifications
You must be signed in to change notification settings - Fork 215
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
Update otel proto buf specification #5434
base: main
Are you sure you want to change the base?
Update otel proto buf specification #5434
Conversation
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
862fbe2
to
a1c3d6c
Compare
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.
Thanks for submitting this PR. Let's try to get rid of the TODOs. I am not sure about the Kafka integration tests. The seem to fail in the build pipeline. Maybe @kkondaka can support?
...o-common/src/test/java/org/opensearch/dataprepper/plugins/otel/codec/OTelProtoCodecTest.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/opensearch/dataprepper/plugins/source/oteltrace/OTelTraceGrpcService.java
Outdated
Show resolved
Hide resolved
...c/integrationTest/java/org/opensearch/dataprepper/integration/trace/EndToEndRawSpanTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
0749be9
to
77feae9
Compare
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
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.
The huge number of deletions in the OTelMetricsProtoHelper
look scary. But the methods were unused due to the migration to the OTelProtoCodec
. There are still test failures in the Kafka integration tests. I triggered the build pipeline, so that we get a full picture. @kkondaka can you assist with the Kafka tests?
@TomasLongo looks like some tests are failing because of @TomasLongo @KarstenSchnitter what's the impact of updating to latest version with customers who may be using older version to send data? |
@TomasLongo I think we should remove 0.9 0-alpha from |
In the PR introducing the
This is also evident from the I think we are good to go with the upgrade. |
Signed-off-by: Tomas Longo <tomas.longo@sap.com>
@kkondaka I've removed the old versions from the e2e-raw-span-test. At least, locally, the test is green now. |
@KarstenSchnitter just to understand what you wrote, if some customer is still using OLD (pre feb-2021) logs generator which has "instrumentationLibrary", what happens when DataPrepper receives it, it will be dropped silently, right? (I understand there won't be any other issues or errors) |
@kkondaka: If you used an Otel instrumentation pre-March 2022 it would generate a binary representation of the instrumentation library, that all post-March 2022 implementations would read as instrumentation scope. This is evident by the indices used in the |
"schemaUrl": "schemaurl" | ||
}, | ||
{ | ||
"resource": { |
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.
Why "resource" section removed? I think it is still valid in the new protocol spec, right?
Thanks @KarstenSchnitter for elaborating on this. As I understand this is not a breaking change and I'm good to move forward. Looking at the original PR I see that the index was the same, so this is backward compatible. The grace period was specifically to help the receiver (Data Prepper) and sender begin to migrate without immediate code changes. We've missed that, so we do have to change the code. |
@@ -14,7 +14,7 @@ jobs: | |||
strategy: | |||
matrix: | |||
java: [11, 17, 21, docker] | |||
otelVersion: ['0.9.0-alpha', '0.16.0-alpha'] | |||
otelVersion: ['1.3.2-alpha'] |
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.
Can we keep an old version in here and still have tests pass? I'd expect this to be ok since the wire format is unchanged.
otelVersion: ['0.16.0-alpha', '1.3.2-alpha']
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.
@dlvenable I do not think that's possible.
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.
Why not? The wire format is the same is it not?
@@ -40,14 +31,7 @@ public final class OTelMetricsProtoHelper { | |||
|
|||
private static final Logger LOG = LoggerFactory.getLogger(OTelMetricsProtoHelper.class); | |||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); | |||
private static final String SERVICE_NAME = "service.name"; |
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.
Thank you for cleaning up these unused methods and names!
@@ -198,17 +193,6 @@ protected Collection<OpenTelemetryLog> parseResourceLogs(ResourceLogs rs, final | |||
final Map<String, Object> resourceAttributes = OTelProtoCodec.getResourceAttributes(rs.getResource()); | |||
final String schemaUrl = rs.getSchemaUrl(); | |||
|
|||
Stream<OpenTelemetryLog> mappedInstrumentationLibraryLogs = rs.getInstrumentationLibraryLogsList() |
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.
Why are these removed and not changed to iterate of getScopeLogs()
?
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.
scopeLogs is being processed in rs.getScopeLogsList().stream()
below
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 already supported scopeLogs, etc. Great! I see this now.
@@ -239,22 +223,6 @@ protected Map<String, ResourceSpans> splitResourceSpansByTraceId(final ResourceS | |||
} | |||
} | |||
|
|||
if (resourceSpans.getInstrumentationLibrarySpansList().size() > 0) { |
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.
Similar comment as one above: Why is this removed entirely?
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.
@dlvenable that API doesn't exist, so it is removed. The if (resourceSpans.getScopeSpansList().size() > 0) {
processing scopeSpans.
@@ -306,38 +270,6 @@ private Map<String, List<ScopeSpans>> splitScopeSpansByTraceId(final List<ScopeS | |||
return result; | |||
} | |||
|
|||
private List<Span> parseInstrumentationLibrarySpans(final List<InstrumentationLibrarySpans> instrumentationLibrarySpansList, |
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.
Same question: Why is this removed entirely?
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.
This API removed because the underlying function ( instrumentationLibrarySpans.getInstrumentationLibrary()
) is not valid anymore
Thank you @TomasLongo for working on this important update! |
@TomasLongo The new spec adds "attributes" under "instrumentationScope", we should be able to do |
Description
Updates the otel proto buf specifications.
This is a breaking change, since the otel proto buf specification removes InstrumentationLibrary* objects and replaces them with Scope* object. This also changes the hierarchy of the data structure
Issues Resolved
relates to #5322
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.