Skip to content

Commit

Permalink
refactor: update docs (README, comment in examples)
Browse files Browse the repository at this point in the history
  • Loading branch information
anhvietnguyennva committed Aug 31, 2023
1 parent 8d5a61b commit 33056c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ In order to push customized metrics to Kyber's self-hosted agent, you have to in
### Configurations
When initializing the global TracerProvider and global MeterProvider, `kyber-trace-go` loads configurations from the following environment variables:
- OTEL_ENABLED: `kyber-trace-go` only initializes global `TracerProvider` and global `MeterProvider` if `OTEL_ENABLED = true`
- OTEL_AGENT_HOST: The host of the agent where traces, spans, customized metrics will be sent to. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_METRIC_AGENT_GRPC_PORT: The gRPC port of the agent where customized metrics will be sent to. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_METRIC_AGENT_HTTP_PORT: The HTTP port of the agent where customized metrics will be sent to. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_TRACE_AGENT_GRPC_PORT: The gRPC port of the agent where traces, spans will be sent to. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_TRACE_AGENT_HTTP_PORT: The HTTP port of the agent where traces, spans will be sent to. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_INSECURE: Disables client transport security for HTTP/gRPC connection when connecting to agent. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be set to `true` automatically.
- OTEL_AGENT_HOST: The host of the agent where traces, spans, customized metrics will be sent to. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_METRIC_AGENT_GRPC_PORT: The gRPC port of the agent where customized metrics will be sent to. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_METRIC_AGENT_HTTP_PORT: The HTTP port of the agent where customized metrics will be sent to. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_TRACE_AGENT_GRPC_PORT: The gRPC port of the agent where traces, spans will be sent to. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_TRACE_AGENT_HTTP_PORT: The HTTP port of the agent where traces, spans will be sent to. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in kyber-application. Otherwise, you have to set it yourself.
- OTEL_INSECURE: Disables client transport security for HTTP/gRPC connection when connecting to agent. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be set to `true` automatically.
- OTEL_PROTOCOL: Specify which protocol will be used to connect to the agent. Enum: `grpc`, `http`. The default value is `grpc`. Only add this environment variable to your `value.yaml` in kyber-application when you want to use `http`.
- OTEL_SERVICE_NAME: Name of your service which can be used in your query in grafana jaeger. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in `kyber-application`. Otherwise, you have to set it yourself.
- OTEL_SERVICE_VERSION: The current version of your service. If you are using helm chart with dependency `base-service` version `0.5.15` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in `kyber-application`. Otherwise, you have to set it to your current image tag.
- OTEL_SERVICE_NAME: Name of your service which can be used in your query in grafana jaeger. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in `kyber-application`. Otherwise, you have to set it yourself.
- OTEL_SERVICE_VERSION: The current version of your service. If you are using helm chart with dependency `base-service` version `0.5.16` or later, this environment variable will be injected via helm chart, and you don't need to set it in your `values.yaml` in `kyber-application`. Otherwise, you have to set it to your current image tag.
- OTEL_TRACE_SAMPLE_RATE: The default value is `0.5`. If you want your all traces and spans will be recorded, set `OTEL_TRACE_SAMPLE_RATE = 1`

### For gin framework
Expand Down
4 changes: 2 additions & 2 deletions example/gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func GinFramework() {
// export OTEL_METRIC_AGENT_GRPC_PORT=4315
// export OTEL_INSECURE=true

// When you deploy your service using helm chart with base-service from version 0.5.15, the following variables will be injected directly via helm chart:
// When you deploy your service using helm chart with base-service from version 0.5.16, the following variables will be injected directly via helm chart:
// OTEL_AGENT_HOST, OTEL_SERVICE_NAME, OTEL_SERVICE_VERSION, OTEL_TRACE_AGENT_GRPC_PORT, OTEL_METRIC_AGENT_GRPC_PORT, OTEL_INSECURE
// You just need to set OTEL_ENABLED, OTEL_TRACE_SAMPLE_RATE.
// You just need to set OTEL_ENABLED.

server := newServer()
err := server.Run()
Expand Down
4 changes: 2 additions & 2 deletions example/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ func PushMetric() {
// export OTEL_METRIC_AGENT_GRPC_PORT=4315
// export OTEL_INSECURE=true

// When you deploy your service using helm chart with base-service from version 0.5.15, the following variables will be injected directly via helm chart:
// When you deploy your service using helm chart with base-service from version 0.5.16, the following variables will be injected directly via helm chart:
// OTEL_AGENT_HOST, OTEL_SERVICE_NAME, OTEL_SERVICE_VERSION, OTEL_TRACE_AGENT_GRPC_PORT, OTEL_METRIC_AGENT_GRPC_PORT, OTEL_INSECURE
// You just need to set OTEL_ENABLED, OTEL_TRACE_SAMPLE_RATE.
// You just need to set OTEL_ENABLED.

counter, err := metric.Meter().Int64Counter("example_count_metric")
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions example/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func Tracing() {
// export OTEL_METRIC_AGENT_GRPC_PORT=4315
// export OTEL_INSECURE=true

// When you deploy your service using helm chart with base-service from version 0.5.15, the following variables will be injected directly via helm chart:
// When you deploy your service using helm chart with base-service from version 0.5.16, the following variables will be injected directly via helm chart:
// OTEL_AGENT_HOST, OTEL_SERVICE_NAME, OTEL_SERVICE_VERSION, OTEL_TRACE_AGENT_GRPC_PORT, OTEL_METRIC_AGENT_GRPC_PORT, OTEL_INSECURE
// You just need to set OTEL_ENABLED, OTEL_TRACE_SAMPLE_RATE.
// You just need to set OTEL_ENABLED.

ctx := context.Background()

Expand Down

0 comments on commit 33056c3

Please sign in to comment.