Skip to content
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

Remove support for OTEL spanmetrics processor #5539

Merged
merged 27 commits into from
Jun 11, 2024

Conversation

varshith257
Copy link
Contributor

@varshith257 varshith257 commented Jun 5, 2024

Which problem is this PR solving?

Description of the changes

  • removed support for the spanmetrics processor flag.

How was this change tested?

  • CI

Checklist

Signed-off-by: Vamshi Maskuri <[email protected]>
@varshith257 varshith257 requested a review from a team as a code owner June 5, 2024 04:52
@varshith257 varshith257 requested a review from joe-elliott June 5, 2024 04:52
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.20%. Comparing base (6f2fe36) to head (f5ff0d7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5539      +/-   ##
==========================================
- Coverage   96.20%   96.20%   -0.01%     
==========================================
  Files         327      327              
  Lines       16021    16006      -15     
==========================================
- Hits        15413    15398      -15     
  Misses        432      432              
  Partials      176      176              
Flag Coverage Δ
badger_v1 8.05% <ø> (ø)
badger_v2 1.93% <ø> (ø)
cassandra-3.x-v1 16.45% <ø> (ø)
cassandra-3.x-v2 1.85% <ø> (ø)
cassandra-4.x-v1 16.45% <ø> (ø)
cassandra-4.x-v2 1.85% <ø> (ø)
elasticsearch-7.x-v1 18.88% <ø> (ø)
elasticsearch-8.x-v1 19.09% <ø> (ø)
elasticsearch-8.x-v2 19.07% <ø> (ø)
grpc_v1 9.48% <ø> (+0.01%) ⬆️
grpc_v2 7.53% <ø> (ø)
kafka 9.77% <ø> (ø)
opensearch-1.x-v1 18.94% <ø> (ø)
opensearch-2.x-v1 18.94% <ø> (ø)
opensearch-2.x-v2 18.94% <ø> (+0.01%) ⬆️
unittests 94.07% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@varshith257
Copy link
Contributor Author

@yurishkuro Still there any to remove? These are files mainly updated in the PR linked in the ticket for dual support of the processor and connector.

And for README, can we keep the migration guide or remove it?

docker-compose/monitor/README.md Outdated Show resolved Hide resolved
plugin/metrics/prometheus/options.go Outdated Show resolved Hide resolved
plugin/metrics/prometheus/options.go Outdated Show resolved Hide resolved
docker-compose/monitor/README.md Outdated Show resolved Hide resolved
Signed-off-by: Vamshi Maskuri <[email protected]>
Signed-off-by: Vamshi Maskuri <[email protected]>
@varshith257
Copy link
Contributor Author

@albertteoh PTAL. I have also removed the migration guide. Would you also like me to update the configuration of the spanmetrics connector replacing the migration guide there?

@varshith257 varshith257 requested a review from albertteoh June 5, 2024 09:31
Signed-off-by: Vamshi Maskuri <[email protected]>
Signed-off-by: Vamshi Maskuri <[email protected]>
Signed-off-by: Vamshi Maskuri <[email protected]>
Signed-off-by: Vamshi Maskuri <[email protected]>
@varshith257 varshith257 requested a review from albertteoh June 5, 2024 09:57
Signed-off-by: Vamshi Maskuri <[email protected]>
Signed-off-by: Vamshi Maskuri <[email protected]>
@albertteoh
Copy link
Contributor

Looks like the tests need updating.

Signed-off-by: Vamshi Maskuri <[email protected]>
@varshith257
Copy link
Contributor Author

varshith257 commented Jun 5, 2024

Yeah! Just fixed now

@varshith257
Copy link
Contributor Author

varshith257 commented Jun 5, 2024

@albertteoh The tests are failing as I update with the operation label as expected and converse it failing again with no need for an operation label :)

Before:
https://github.com/jaegertracing/jaeger/actions/runs/9381948382/job/25832322664

            	Error Trace:	/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:956
            	            				/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:483
            	Error:      	Not equal: 
            	            	expected: 2
            	            	actual  : 1
            	Test:       	TestGetErrorRates/enable_support_for_spanmetrics_connector_with_normalized_metric_name
        reader_test.go:962: 
            	Error Trace:	/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:962
            	            				/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:483
            	Error:      	Should be empty, but was map[operation:/OrderResult]
            	Test:       	TestGetErrorRates/enable_support_for_spanmetrics_connector_with_normalized_metric_name
FAIL

and this one after updating tests as fails in above unit tests fail:

https://github.com/jaegertracing/jaeger/actions/runs/9383740294/job/25838045548
            	Test:       	TestGetErrorRates/enable_support_for_spanmetrics_connector_with_normalized_metric_name
        reader_test.go:950: 
            	Error Trace:	/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:950
            	            				/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:477
            	Error:      	Not equal: 
            	            	expected: 1
            	            	actual  : 2
            	Test:       	TestGetErrorRates/enable_support_for_spanmetrics_connector_with_normalized_metric_name
        reader_test.go:952: 
            	Error Trace:	/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:952
            	            				/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:477
            	Error:      	map[string]string{"service_name":"emailservice"} does not contain "operation"
            	Test:       	TestGetErrorRates/enable_support_for_spanmetrics_connector_with_normalized_metric_name
        reader_test.go:953: 
            	Error Trace:	/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:953
            	            				/home/runner/work/jaeger/jaeger/plugin/metrics/prometheus/metricsstore/reader_test.go:477
            	Error:      	Not equal: 
            	            	expected: ""
            	            	actual  : "/OrderResult"

The current definitions of the functions GetLatencies, GetCallRates, and GetErrorRates in the reader.go, it seems these functions are designed to return ErrDisabled indicating that the metrics fetching functionality is disabled or not implemented

Any suggestions on it @albertteoh @yurishkuro ?

varshith257 and others added 3 commits June 6, 2024 16:47
@varshith257
Copy link
Contributor Author

varshith257 commented Jun 6, 2024

@albertteoh It's 100% hit of test coverage now for this patch :)

@varshith257 varshith257 requested a review from albertteoh June 6, 2024 12:14
@varshith257
Copy link
Contributor Author

@yurishkuro PTAL and review the changes

@yurishkuro yurishkuro added the changelog:breaking-change Change that is breaking public APIs or established behavior label Jun 7, 2024
@varshith257 varshith257 requested a review from yurishkuro June 7, 2024 07:51
Signed-off-by: Vamshi Maskuri <[email protected]>
@varshith257
Copy link
Contributor Author

varshith257 commented Jun 7, 2024

@albertteoh @yurishkuro have added back the var operation => span_name. It fails tests and creates confusion about the already existing span_name variable there. Isn't it span.name instead span_name as mentioned in the migration guide

The operation metric attribute was renamed to span.name.

Signed-off-by: Vamshi Maskuri <[email protected]>
@albertteoh
Copy link
Contributor

Isn't it span.name instead span_name as mentioned in the migration guide

@varshith257 From: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/translator/prometheus/README.md#labels

You'll see that one of the normalization steps performed to convert an OTLP attribute name to Prometheus is to: "Drop unsupported characters and replace with underscores (_)"

The example given there is to replace host.name -> host_name.

@varshith257
Copy link
Contributor Author

varshith257 commented Jun 8, 2024

The two lines mentioned for changing in fn of mock Prometheus Server have updated to span_name. After debugging the metricLabel in reader.go is still pointing to operation in tests though we already changed in reader go. But, I can't pinpoint where still this operation label is emitting from, though we have removed most of it references

Error: map[string]string{"service_name":"emailservice"} does not contain "operation"

I have updated the mapping function for it in assert labels to map operation => span_name

varshith257 and others added 2 commits June 10, 2024 08:19
Signed-off-by: Vamshi Maskuri <[email protected]>
Signed-off-by: Vamshi Maskuri <[email protected]>
@varshith257
Copy link
Contributor Author

@albertteoh PTAL

@yurishkuro yurishkuro merged commit ada5569 into jaegertracing:main Jun 11, 2024
40 checks passed
@varshith257 varshith257 deleted the cleanup-processor branch June 11, 2024 14:12
yurishkuro added a commit that referenced this pull request Jun 22, 2024
## Which problem is this PR solving?
- Resolves #5672
- Due to oversight, a bug was introduced in #5539 which changed the
attribute name expected by the UI from `operation` to `span_name`

## Description of the changes
- Revert those changes

## How was this change tested?
`(cd docker-compose/monitor/ && make build dev)`

<img width="1910" alt="image"
src="https://github.com/jaegertracing/jaeger/assets/3523016/79400073-75f1-4db5-8bef-9a4c439d2852">


## Checklist
- [ ] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [ ] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [ ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro
Copy link
Member

reverted changes to "operation" label #5673

yurishkuro added a commit that referenced this pull request Jun 22, 2024
## Which problem is this PR solving?
- Resolves #5672
- Due to oversight, a bug was introduced in #5539 which changed the
attribute name expected by the UI from `operation` to `span_name`

## Description of the changes
- Revert those changes

## How was this change tested?
`(cd docker-compose/monitor/ && make build dev)`

<img width="1910" alt="image"
src="https://github.com/jaegertracing/jaeger/assets/3523016/79400073-75f1-4db5-8bef-9a4c439d2852">


## Checklist
- [ ] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [ ] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [ ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Yuri Shkuro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:breaking-change Change that is breaking public APIs or established behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants