Skip to content

WIP OTel Agent e2e pipeline tests #28866

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

Closed
wants to merge 4 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package logsagentexporter
import (
"context"
"errors"
"fmt"
"strings"
"time"

Expand Down Expand Up @@ -66,6 +67,7 @@ func (e *Exporter) ConsumeLogs(ctx context.Context, ld plog.Logs) (err error) {

payloads := e.translator.MapLogs(ctx, ld)
for _, ddLog := range payloads {
fmt.Printf("ddLog.Hostname: %v\n", ddLog.Hostname)
tags := strings.Split(ddLog.GetDdtags(), ",")
// Tags are set in the message origin instead
ddLog.Ddtags = nil
Expand All @@ -90,6 +92,11 @@ func (e *Exporter) ConsumeLogs(ctx context.Context, ld plog.Logs) (err error) {
// ingestionTs is an internal field used for latency tracking on the status page, not the actual log timestamp.
ingestionTs := time.Now().UnixNano()
message := message.NewMessage(content, origin, status, ingestionTs)
fmt.Printf("message.Hostname before: %v\n", message.Hostname)
if ddLog.Hostname != nil {
message.Hostname = *ddLog.Hostname
}
fmt.Printf("message.Hostname after: %v\n", message.Hostname)

e.logsAgentChannel <- message
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ exporters:
datadog:
traces:
span_name_as_resource_name: true
metrics:
resource_attributes_as_tags: true
hostname: "otelcol-docker"
api:
key: ${DD_API_KEY}
debug:
verbosity: detailed
processors:
batch:
connectors:
Expand All @@ -20,8 +24,12 @@ connectors:
traces:
span_name_as_resource_name: true
compute_stats_by_span_kind: true
compute_top_level_by_span_kind: true
peer_tags_aggregation: true
service:
telemetry:
logs:
level: debug
pipelines:
traces:
receivers: [otlp]
Expand All @@ -38,4 +46,4 @@ service:
logs:
receivers: [otlp]
processors: [batch]
exporters: [datadog]
exporters: [datadog, debug]
Loading
Loading