Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion internal/ingest/metric_fidelity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestMetricIngestKeepsKindTemporalityAndStart(t *testing.T) {
t.Fatalf("point %d: %+v", i, got)
}
}
if err := store.CommitBatch(t.Context(), telemetry.BatchMetadata{ID: "ingest_series"}, nil, nil, captured); err != nil {
if err := store.CommitBatch(t.Context(), &telemetry.BatchMetadata{ID: "ingest_series"}, nil, nil, captured); err != nil {
t.Fatal(err)
}
physical, err := parquet.ReadFile[struct {
Expand Down
11 changes: 0 additions & 11 deletions internal/ingest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"math"
"strconv"
"strings"
"time"

collectorlogs "go.opentelemetry.io/proto/otlp/collector/logs/v1"
collectormetrics "go.opentelemetry.io/proto/otlp/collector/metrics/v1"
Expand Down Expand Up @@ -71,7 +70,6 @@ func (ts *traceService) Export(ctx context.Context, req *collectortrace.ExportTr

func (s *Server) exportTraces(ctx context.Context, req *collectortrace.ExportTraceServiceRequest) (*collectortrace.ExportTraceServiceResponse, error) {
cfg := s.cfg
now := time.Now().UnixNano()
count := 0
for _, rs := range req.ResourceSpans {
for _, ss := range rs.ScopeSpans {
Expand Down Expand Up @@ -126,7 +124,6 @@ func (s *Server) exportTraces(ctx context.Context, req *collectortrace.ExportTra
Flags: sp.Flags,
ScopeName: scopeName,
ScopeVersion: scopeVer,
IngestedAt: now,
// Pre-extracted OTel semantic convention attributes.
HTTPMethod: spanAttr(sp.Attributes, "http.method", "http.request.method"),
HTTPStatusCode: spanAttrInt(sp.Attributes, "http.status_code", "http.response.status_code"),
Expand Down Expand Up @@ -171,7 +168,6 @@ func (ls *logsService) Export(ctx context.Context, req *collectorlogs.ExportLogs

func (s *Server) exportLogs(ctx context.Context, req *collectorlogs.ExportLogsServiceRequest) (*collectorlogs.ExportLogsServiceResponse, error) {
cfg := s.cfg
now := time.Now().UnixNano()
count := 0
for _, rl := range req.ResourceLogs {
for _, sl := range rl.ScopeLogs {
Expand Down Expand Up @@ -217,7 +213,6 @@ func (s *Server) exportLogs(ctx context.Context, req *collectorlogs.ExportLogsSe
Attributes: attrs,
ScopeName: scopeName,
ScopeVersion: scopeVer,
IngestedAt: now,
}
batch.Logs = append(batch.Logs, row)
}
Expand All @@ -237,7 +232,6 @@ func (ms *metricsService) Export(ctx context.Context, req *collectormetrics.Expo

func (s *Server) exportMetrics(ctx context.Context, req *collectormetrics.ExportMetricsServiceRequest) (*collectormetrics.ExportMetricsServiceResponse, error) {
cfg := s.cfg
now := time.Now().UnixNano()
count := 0
for _, rm := range req.ResourceMetrics {
for _, sm := range rm.ScopeMetrics {
Expand Down Expand Up @@ -296,7 +290,6 @@ func (s *Server) exportMetrics(ctx context.Context, req *collectormetrics.Export
Resource: resources,
ScopeName: scopeName,
ScopeVersion: scopeVer,
IngestedAt: now,
}
row.SeriesID = telemetry.MetricSeriesID(row)
batch.Metrics = append(batch.Metrics, row)
Expand Down Expand Up @@ -328,7 +321,6 @@ func (s *Server) exportMetrics(ctx context.Context, req *collectormetrics.Export
Resource: resources,
ScopeName: scopeName,
ScopeVersion: scopeVer,
IngestedAt: now,
}
row.SeriesID = telemetry.MetricSeriesID(row)
batch.Metrics = append(batch.Metrics, row)
Expand Down Expand Up @@ -366,7 +358,6 @@ func (s *Server) exportMetrics(ctx context.Context, req *collectormetrics.Export
Resource: resources,
ScopeName: scopeName,
ScopeVersion: scopeVer,
IngestedAt: now,
}
row.SeriesID = telemetry.MetricSeriesID(row)
batch.Metrics = append(batch.Metrics, row)
Expand Down Expand Up @@ -408,7 +399,6 @@ func (s *Server) exportMetrics(ctx context.Context, req *collectormetrics.Export
Resource: resources,
ScopeName: scopeName,
ScopeVersion: scopeVer,
IngestedAt: now,
}
row.SeriesID = telemetry.MetricSeriesID(row)
batch.Metrics = append(batch.Metrics, row)
Expand Down Expand Up @@ -436,7 +426,6 @@ func (s *Server) exportMetrics(ctx context.Context, req *collectormetrics.Export
Resource: resources,
ScopeName: scopeName,
ScopeVersion: scopeVer,
IngestedAt: now,
}
row.SeriesID = telemetry.MetricSeriesID(row)
batch.Metrics = append(batch.Metrics, row)
Expand Down
4 changes: 2 additions & 2 deletions internal/intelligence/annotations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ func TestDetectorAnnotationMapping(t *testing.T) {
}
defer duck.Close()
at := time.Now().UTC().Truncate(time.Minute)
snapshot := IntelligenceSnapshot{GeneratedAt: at, Anomalies: []Anomaly{{ServiceName: "checkout", Type: AnomalyLatencyDegradation, ZScore: -4, DetectedAt: at, Description: "Slow"}, {ServiceName: "payment", Type: AnomalyVolumeChange, ZScore: 3, DetectedAt: at, Description: "Low volume"}}}
findings := detectorAnnotations(snapshot, "shop", 5*time.Minute)
snapshot := IntelligenceSnapshot{GeneratedAt: at, Anomalies: []Anomaly{{ServiceName: "checkout", Type: AnomalyLatencyDegradation, ZScore: -4, DetectedAt: at, WindowStart: at.Add(-5 * time.Minute), WindowEnd: at, Description: "Slow"}, {ServiceName: "payment", Type: AnomalyVolumeChange, ZScore: 3, DetectedAt: at, WindowStart: at.Add(-5 * time.Minute), WindowEnd: at, Description: "Low volume"}}}
findings := detectorAnnotations(snapshot, "shop")
if err := duck.RecordAnomalies(t.Context(), findings, at); err != nil {
t.Fatal(err)
}
Expand Down
Loading
Loading