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

Create metrics.Factory adapter for OTEL Metrics #5661

Merged
merged 52 commits into from
Jun 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f1f9b7a
Instantiated OTEL Metrics
Wise-Wizard Jun 19, 2024
12403b1
Ran make fmt
Wise-Wizard Jun 19, 2024
175efa3
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 20, 2024
443858f
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 20, 2024
0a073b6
Create otelmetrics package
Wise-Wizard Jun 21, 2024
aa92107
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 21, 2024
7efd9b9
Update pkg/metrics/otelmetrics/factory.go
Wise-Wizard Jun 21, 2024
a70d64a
Created benchmark to compare metric implementation
Wise-Wizard Jun 22, 2024
2ab543b
Merge branch 'OTEL_Metrics' of https://github.com/Wise-Wizard/jaeger …
Wise-Wizard Jun 22, 2024
dc2a9ed
Resolved conflicts
Wise-Wizard Jun 22, 2024
f508b8a
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 22, 2024
4a99291
avoid allocations
yurishkuro Jun 22, 2024
099ba05
Implemented changes
Wise-Wizard Jun 22, 2024
21c14b4
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 23, 2024
8b47b12
Used metrics.NullCounter as return type
Wise-Wizard Jun 23, 2024
8032ce2
Created rough implementation of OTEL SDK
Wise-Wizard Jun 23, 2024
6ec5ec4
Fixed initialization errors
Wise-Wizard Jun 24, 2024
33d5855
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 24, 2024
4e7dcbb
Made suggested changes
Wise-Wizard Jun 24, 2024
f29cad5
Created Prometheus Exporter
Wise-Wizard Jun 24, 2024
67e23e2
Implemented OTEL Metrics for other Instruments
Wise-Wizard Jun 25, 2024
b434c20
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 25, 2024
598c39f
Update internal/metrics/otelmetrics/factory.go
Wise-Wizard Jun 25, 2024
29f6382
Update internal/metrics/benchmark_test.go
Wise-Wizard Jun 25, 2024
51bd2f0
Update internal/metrics/benchmark_test.go
Wise-Wizard Jun 25, 2024
22fe680
Update internal/metrics/otelmetrics/factory.go
Wise-Wizard Jun 25, 2024
6f41a52
Refactored Code
Wise-Wizard Jun 25, 2024
a6212bb
Added Unit
Wise-Wizard Jun 25, 2024
8594dc2
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 26, 2024
d6347c4
Added Namespace Configuration
Wise-Wizard Jun 26, 2024
1c667f2
Added Factory Test File
Wise-Wizard Jun 26, 2024
61df6b0
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 26, 2024
f6fce72
Added missing value
Wise-Wizard Jun 26, 2024
a42e1fe
Added missing value
Wise-Wizard Jun 26, 2024
3594d80
Made changes to Test Suites
Wise-Wizard Jun 27, 2024
0a24e87
Made Required changes in Test
Wise-Wizard Jun 27, 2024
362ea74
Removed No-Op Test
Wise-Wizard Jun 27, 2024
7deeb6b
Added Go Leak Test
Wise-Wizard Jun 27, 2024
92ea1bb
Fixed Alias Error
Wise-Wizard Jun 27, 2024
47c2aed
Update internal/metrics/otelmetrics/factory_test.go
Wise-Wizard Jun 27, 2024
36dda89
Implemented missing Tests
Wise-Wizard Jun 27, 2024
d4ee6e0
Created Table Driven Test
Wise-Wizard Jun 27, 2024
5e7c624
Added invalid test for all metrics
Wise-Wizard Jun 28, 2024
965ad84
Added check for Empty Namespace
Wise-Wizard Jun 28, 2024
43de5d1
Disabled OTEL Scope Info
Wise-Wizard Jun 28, 2024
878e5f4
Test Nested Namespace
Wise-Wizard Jun 28, 2024
864acde
Ran make Lint
Wise-Wizard Jun 28, 2024
0054c5c
Ran make fmt
Wise-Wizard Jun 28, 2024
7188cc8
Update internal/metrics/otelmetrics/factory_test.go
Wise-Wizard Jun 30, 2024
7916122
Merge branch 'main' into OTEL_Metrics
Wise-Wizard Jun 30, 2024
e0d7fdb
Added Empty Namespace Test
Wise-Wizard Jun 30, 2024
3265bc0
Refactored Test
Wise-Wizard Jun 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ran make fmt
Signed-off-by: Wise-Wizard <[email protected]>
  • Loading branch information
Wise-Wizard committed Jun 19, 2024
commit 12403b18b335440adbeb32237e4df02223418b87
9 changes: 6 additions & 3 deletions pkg/metrics/otelCounter.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2024 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package metrics

import (
Expand All @@ -10,19 +13,19 @@
// otelCounter is a wrapper around otel.Counter

type otelCounter struct {
counter metric.Int64Counter
ctx context.Context
attrs []metric.AddOption
counter metric.Int64Counter
ctx context.Context
attrs []metric.AddOption
}

func (c *otelCounter) Inc(value int64) {
c.counter.Add(c.ctx, value, c.attrs...)

Check warning on line 22 in pkg/metrics/otelCounter.go

View check run for this annotation

Codecov / codecov/patch

pkg/metrics/otelCounter.go#L21-L22

Added lines #L21 - L22 were not covered by tests
}

func getAttributes(tags map[string]string) []metric.AddOption {
var options []metric.AddOption
for k, v := range tags {
options = append(options, metric.WithAttributes(attribute.String(k, v)))

Check warning on line 28 in pkg/metrics/otelCounter.go

View check run for this annotation

Codecov / codecov/patch

pkg/metrics/otelCounter.go#L25-L28

Added lines #L25 - L28 were not covered by tests
}
return options

Check warning on line 30 in pkg/metrics/otelCounter.go

View check run for this annotation

Codecov / codecov/patch

pkg/metrics/otelCounter.go#L30

Added line #L30 was not covered by tests
}
Loading