From fc25738d5a0fc52b839890395f200265dc0f47a8 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Tue, 23 Feb 2021 10:10:19 +0100 Subject: [PATCH 1/2] Add exporter type config option Signed-off-by: Pavol Loffay --- config.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.proto b/config.proto index 5983edd..0242fba 100644 --- a/config.proto +++ b/config.proto @@ -46,6 +46,9 @@ message Reporting { // opa describes the setting related to the Open Policy Agent Opa opa = 4; + + // reporter type - zipkin or otlp. Defaults to Zipkin, in the future it will change to otlp. + google.protobuf.StringValue reporter_type = 5; } // Opa covers the options related to the mechanics for getting Open Policy Agent configuration file. From a1f11473155e4f9f936043cd380b45cdc6d6ac6b Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Tue, 23 Feb 2021 11:05:35 +0100 Subject: [PATCH 2/2] Use enum Signed-off-by: Pavol Loffay --- ENV_VARS.md | 2 +- Makefile | 7 +++++-- config.proto | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ENV_VARS.md b/ENV_VARS.md index bc37eb5..634cd41 100644 --- a/ENV_VARS.md +++ b/ENV_VARS.md @@ -25,4 +25,4 @@ Agents can be configured using environment variables: | HT_DATA_CAPTURE_BODY_MAX_SIZE_BYTES | Maximum size of captured body in bytes. Default should be 131_072 (128 KiB). | | HT_PROPAGATION_FORMATS | List the supported propagation formats e.g. `HT_PROPAGATION_FORMATS="B3,TRACECONTEXT"`. | | HT_ENABLED | When `false`, disables the agent | -| HT_JAVAAGENT_FILTER_JAR_PATHS | Is the list of path to filter jars, separated by `,` | +| HT_JAVAAGENT_FILTER_JAR_PATHS | Is the list of path to filter jars, separated by `,`. | diff --git a/Makefile b/Makefile index fa86583..4d6c4ee 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: default help +.PHONY: default help lint generate-env-vars init-git-submodule default: help @@ -8,7 +8,7 @@ help: ## Prints this help. lint: ## Lints the proto files. protolint config.proto -generate-env-vars: ## Generates the ENV_VARS.md with all environment variables. +generate-env-vars: init-git-submodule ## Generates the ENV_VARS.md with all environment variables. docker build -t hypertrace/agent-config/env-vars-generator tools/env-vars-generator docker run \ -v $(PWD)/ENV_VARS.md:/usr/local/ENV_VARS.md \ @@ -16,3 +16,6 @@ generate-env-vars: ## Generates the ENV_VARS.md with all environment variables. hypertrace/agent-config/env-vars-generator \ -o /usr/local/ENV_VARS.md \ /usr/local/config.proto + +init-git-submodule: + git submodule update --init diff --git a/config.proto b/config.proto index 0242fba..a69f233 100644 --- a/config.proto +++ b/config.proto @@ -47,8 +47,8 @@ message Reporting { // opa describes the setting related to the Open Policy Agent Opa opa = 4; - // reporter type - zipkin or otlp. Defaults to Zipkin, in the future it will change to otlp. - google.protobuf.StringValue reporter_type = 5; + // reporter type. Defaults to zipkin, in the future it will change to otlp. + TraceReporterType trace_reporter_type = 5; } // Opa covers the options related to the mechanics for getting Open Policy Agent configuration file. @@ -102,6 +102,17 @@ enum PropagationFormat { TRACECONTEXT = 1; } +// TraceReporterType represents the reporting format for trace data. +enum TraceReporterType { + // Zipkin protobuf reporting format. + // see https://github.com/openzipkin/zipkin-api + ZIPKIN = 0; + + // OpenTelemetry protobuf reporting format. + // see https://github.com/open-telemetry/opentelemetry-proto + OTLP = 1; +} + // JavaAgent has the configs specific to javaagent message JavaAgent { // filter_jar_paths is the list of path to filter jars, separated by `,`