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

Added _total suffix to OTEL counter metrics. #5810

Merged
merged 15 commits into from
Aug 8, 2024

Conversation

Wise-Wizard
Copy link
Contributor

Which problem is this PR solving?

This PR addresses a part of the issue #5633

Description of the changes
This is a PR to achieve Observability Parity in metrics between V1 and V2 components by configuring OTEL Collector to emit desired metrics.
How was this change tested?

The changes were tested by running the following command:

make test
CI actions and compare.py script

Checklist

  • I have read 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

@Wise-Wizard Wise-Wizard requested a review from a team as a code owner August 6, 2024 19:31
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.66%. Comparing base (052c89c) to head (ae951e0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5810   +/-   ##
=======================================
  Coverage   96.66%   96.66%           
=======================================
  Files         342      342           
  Lines       16521    16525    +4     
=======================================
+ Hits        15970    15974    +4     
  Misses        362      362           
  Partials      189      189           
Flag Coverage Δ
badger_v1 8.05% <ø> (ø)
badger_v2 1.81% <0.00%> (-0.01%) ⬇️
cassandra-3.x-v1 16.61% <ø> (ø)
cassandra-3.x-v2 1.74% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1 16.61% <ø> (ø)
cassandra-4.x-v2 1.74% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 18.78% <ø> (ø)
elasticsearch-7.x-v1 18.84% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v1 19.03% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v2 1.80% <0.00%> (-0.01%) ⬇️
grpc_v1 9.52% <ø> (ø)
grpc_v2 7.14% <0.00%> (-0.01%) ⬇️
kafka-v1 9.74% <ø> (ø)
kafka-v2 1.80% <0.00%> (-0.02%) ⬇️
memory_v2 1.81% <0.00%> (-0.01%) ⬇️
opensearch-1.x-v1 18.88% <ø> (ø)
opensearch-2.x-v1 18.89% <ø> (ø)
opensearch-2.x-v2 1.81% <0.00%> (-0.01%) ⬇️
unittests 95.09% <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.

@yurishkuro yurishkuro added the changelog:exprimental Change to an experimental part of the code label Aug 7, 2024
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a unit test

internal/metrics/otelmetrics/factory.go Show resolved Hide resolved
@Wise-Wizard
Copy link
Contributor Author

please add a unit test

Sorry, can you specify which Unit test? Because, the tests are already written for counter using _total suffix.

@yurishkuro
Copy link
Member

Sorry, can you specify which Unit test? Because, the tests are already written for counter using _total suffix.

you are adding a new behavior. If you remove that behavior, some test should fail.

@Wise-Wizard
Copy link
Contributor Author

Sorry, can you specify which Unit test? Because, the tests are already written for counter using _total suffix.

you are adding a new behavior. If you remove that behavior, some test should fail.

No, that's the thing without adding that functionality itself the metric names are being added with _total suffix in the tests itself.
In the tests I had to compare with counter_total to pass them.

@yurishkuro
Copy link
Member

The purpose of unit tests is to protect the code from degradation. If I revert the change made in this PR, no unit tests will fail, so you have no protection against functional degradation. We need to add one.

@yurishkuro yurishkuro merged commit eaacbf0 into jaegertracing:main Aug 8, 2024
45 checks passed
JaredTan95 pushed a commit to JaredTan95/jaeger that referenced this pull request Aug 8, 2024
**Which problem is this PR solving?**

This PR addresses a part of the issue [jaegertracing#5633
](jaegertracing#5633)

**Description of the changes**
This is a PR to achieve Observability Parity in metrics between V1 and
V2 components by configuring OTEL Collector to emit desired metrics.
**How was this change tested?**

The changes were tested by running the following command:

```bash
make test
```
```bash
CI actions and compare.py script
```
**Checklist**

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

---------

Signed-off-by: Wise-Wizard <[email protected]>
Signed-off-by: Jared Tan <[email protected]>
JaredTan95 pushed a commit to JaredTan95/jaeger that referenced this pull request Aug 13, 2024
**Which problem is this PR solving?**

This PR addresses a part of the issue [jaegertracing#5633
](jaegertracing#5633)

**Description of the changes**
This is a PR to achieve Observability Parity in metrics between V1 and
V2 components by configuring OTEL Collector to emit desired metrics.
**How was this change tested?**

The changes were tested by running the following command:

```bash
make test
```
```bash
CI actions and compare.py script
```
**Checklist**

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

---------

Signed-off-by: Wise-Wizard <[email protected]>
Signed-off-by: Jared Tan <[email protected]>
JaredTan95 pushed a commit to JaredTan95/jaeger that referenced this pull request Aug 14, 2024
**Which problem is this PR solving?**

This PR addresses a part of the issue [jaegertracing#5633
](jaegertracing#5633)

**Description of the changes**
This is a PR to achieve Observability Parity in metrics between V1 and
V2 components by configuring OTEL Collector to emit desired metrics.
**How was this change tested?**

The changes were tested by running the following command:

```bash
make test
```
```bash
CI actions and compare.py script
```
**Checklist**

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

---------

Signed-off-by: Wise-Wizard <[email protected]>
Signed-off-by: Jared Tan <[email protected]>
JaredTan95 pushed a commit to JaredTan95/jaeger that referenced this pull request Aug 28, 2024
**Which problem is this PR solving?**

This PR addresses a part of the issue [jaegertracing#5633
](jaegertracing#5633)

**Description of the changes**
This is a PR to achieve Observability Parity in metrics between V1 and
V2 components by configuring OTEL Collector to emit desired metrics.
**How was this change tested?**

The changes were tested by running the following command:

```bash
make test
```
```bash
CI actions and compare.py script
```
**Checklist**

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

---------

Signed-off-by: Wise-Wizard <[email protected]>
Signed-off-by: Jared Tan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/otel changelog:exprimental Change to an experimental part of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants