Skip to content

Commit f460aa0

Browse files
committed
add log export code to telemetry
1 parent 524036e commit f460aa0

File tree

8 files changed

+526
-403
lines changed

8 files changed

+526
-403
lines changed

ENV_VARS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
Agents can be configured using environment variables:
77

8+
| Name | Description |
9+
|------|-------------|
10+
| HT_ENABLED | When `true` the thread pool will be activated |
11+
| HT_NUM_WORKERS | Number of workers in the pool |
12+
| HT_BUFFER_SIZE | Buffer size for handling spikes |
13+
814
| Name | Description |
915
|------|-------------|
1016
| HT_SERVICE_NAME | Identifies the service/process running e.g. "my service" |
@@ -30,4 +36,5 @@ Agents can be configured using environment variables:
3036
| HT_JAVAAGENT_FILTER_JAR_PATHS | Is the list of path to filter jars, separated by `,`. The values should be separated by `,`. |
3137
| HT_TELEMETRY_STARTUP_SPAN_ENABLED | When `true`, an internal span is created and exported when the agent is initialized and started. It's useful to denote when the application the agent is in started. |
3238
| HT_TELEMETRY_METRICS_ENABLED | Whether to capture metrics or not. The metrics will be otel go metrics. See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric |
39+
| HT_TELEMETRY_LOGS_ENABLED | When true, logs from the agent will be exported to Traceable Platform Agent via Opentelemetry Logs pipeline. Reporting config is shared with the Traces pipeline. |
3340
| HT_GOAGENT_USE_CUSTOM_BSP | Use the custom batch_span_processor adapted from the one in opentelemetry go and supports some additional metrics |

gen/go/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/hypertrace/agent-config/gen/go
22

3-
go 1.23.2
3+
go 1.24.4
44

55
require (
66
github.com/ghodss/yaml v1.0.0
7-
github.com/stretchr/testify v1.9.0
8-
google.golang.org/protobuf v1.35.1
7+
github.com/stretchr/testify v1.10.0
8+
google.golang.org/protobuf v1.36.7
99
)
1010

1111
require (

gen/go/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
66
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
77
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
88
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
10-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
9+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
10+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1111
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
1212
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
13-
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
14-
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
13+
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
14+
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
1515
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1616
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1717
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

gen/go/proto/v1/config.proto

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,38 @@ message Telemetry {
196196
// Whether to capture metrics or not. The metrics will be otel go metrics.
197197
// See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric
198198
google.protobuf.BoolValue metrics_enabled = 2;
199+
200+
// Configure logs export.
201+
LogsExport logs = 3;
202+
}
203+
204+
// Generic thread pool config for different models
205+
message ThreadPool {
206+
// when `true` the thread pool will be activated
207+
google.protobuf.BoolValue enabled = 1;
208+
// number of workers in the pool
209+
google.protobuf.Int32Value num_workers = 2;
210+
// buffer size for handling spikes
211+
google.protobuf.Int32Value buffer_size = 3;
199212
}
213+
214+
215+
enum LogLevel {
216+
LOG_LEVEL_UNSPECIFIED = 0;
217+
LOG_LEVEL_TRACE = 1;
218+
LOG_LEVEL_DEBUG = 2;
219+
LOG_LEVEL_INFO = 3;
220+
LOG_LEVEL_WARN = 4;
221+
LOG_LEVEL_ERROR = 5;
222+
}
223+
224+
message LogsExport {
225+
// when true, logs from the agent will be exported to Traceable Platform Agent
226+
// via Opentelemetry Logs pipeline. Reporting config is shared with the Traces pipeline.
227+
google.protobuf.BoolValue enabled = 1;
228+
229+
// the level of logs to export, anything below that level will not be exported,
230+
// it'll only be available in the local log file.
231+
232+
LogLevel level = 2;
233+
}

0 commit comments

Comments
 (0)