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

[cmd/otelinmemexporter] Add histogram support #229

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8f3ed3d
Rename new to newInMemExporter to avoid clash with go keyword
ericywl Feb 13, 2025
3888e25
Refactor some code
ericywl Feb 17, 2025
3d081da
Add explicit histogram merging
ericywl Feb 17, 2025
2360b64
Refactor histogram merging
ericywl Feb 18, 2025
36dd8a6
Add explicit buckets quantile function
ericywl Feb 18, 2025
21d5871
Add histogram percentile to store
ericywl Feb 19, 2025
5cbce19
Revert inMemStore to store
ericywl Feb 19, 2025
993bf7f
Merge remote-tracking branch 'origin/main' into otelinmemexporter-add…
ericywl Feb 19, 2025
711c7fc
Fix lint and fmt
ericywl Feb 19, 2025
35de86f
Minor changes to function names and comments; Add test for mixed data…
ericywl Feb 19, 2025
83ac6bd
Remove unnecessary MarshalJSON
ericywl Feb 19, 2025
1360bd9
Add some comments
ericywl Feb 19, 2025
52a9f78
Merge remote-tracking branch 'upstream/main' into otelinmemexporter-a…
ericywl Feb 20, 2025
2402e7d
Add comment and minor name changes
ericywl Feb 20, 2025
aae3bea
Fix unit tests mistake
ericywl Feb 20, 2025
0355991
Add dp test min max
ericywl Feb 20, 2025
091b5d9
Update comment on bucket quantile
ericywl Feb 20, 2025
cb3c7d5
Add comment about delta temporality
ericywl Feb 20, 2025
30f083f
Add comments on Add
ericywl Feb 20, 2025
4eff3d8
Merge branch 'main' into otelinmemexporter-add-histogram
ericywl Feb 24, 2025
508923d
Merge branch 'main' into otelinmemexporter-add-histogram
ericywl Feb 28, 2025
6a06f08
Rename telemetryStore -> metricsStore
ericywl Feb 28, 2025
e56211f
Address review comments
ericywl Mar 10, 2025
1075e12
Merge branch 'main' into otelinmemexporter-add-histogram
ericywl Mar 10, 2025
a6af858
Merge branch 'main' into otelinmemexporter-add-histogram
ericywl Mar 10, 2025
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
Next Next commit
Rename new to newInMemExporter to avoid clash with go keyword
ericywl committed Feb 13, 2025

Verified

This commit was signed with the committer’s verified signature.
ericywl Eric
commit 8f3ed3d016c2b1598969905bf9da4158472dcd94
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# IDE
.vscode
.idea/

.states
dist/
3 changes: 1 addition & 2 deletions cmd/otelinmemexporter/exporter.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ package otelinmemexporter

import (
"context"

"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/collector/pdata/ptrace"
"go.uber.org/zap"
@@ -21,7 +20,7 @@ type inMemExporter struct {
logger *zap.Logger
}

func new(cfg Config, store *Store, logger *zap.Logger) *inMemExporter {
func newInMemExporter(cfg Config, store *Store, logger *zap.Logger) *inMemExporter {
return &inMemExporter{
cfg: cfg,
store: store,
3 changes: 1 addition & 2 deletions cmd/otelinmemexporter/factory.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ package otelinmemexporter
import (
"context"
"fmt"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/consumer"
@@ -48,7 +47,7 @@ func createMetricsExporter(
// Start http server
newServer(store, cfg.Server.Endpoint, logger).Start()

exp := new(*cfg, store, logger)
exp := newInMemExporter(*cfg, store, logger)
return exporterhelper.NewMetrics(
ctx, settings, cfg,
exp.consumeMetrics,
2 changes: 1 addition & 1 deletion cmd/otelinmemexporter/store.go
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ const (
Rate AggregationType = "rate"
)

// Store is a in-memory data store for telemetry data. Data
// Store is an in-memory data store for telemetry data. Data
// exported from the in-memory exporter will be aggregated
// in the Store and queried from the store. Store only stores
// a specfic set of entries specified during creation.