Skip to content

Commit

Permalink
chore: Add an example of using module (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrTitov authored Jul 25, 2023
1 parent 8ea117c commit 7b64093
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
Empty file removed examples/.placeholder
Empty file.
68 changes: 68 additions & 0 deletions examples/otel_collector/k8s/otel_collector_clickhouse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
###
# CRD OpenTelemetry Collector
# API https://github.com/open-telemetry/opentelemetry-operator/blob/42a6d6044efaefd568ceeaec2003dbe35ac3d44d/docs/api.md#opentelemetrycollector
#
# Config:
# * receivers - https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver
# * processors- https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor
# * exporters:
# * logging - https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/loggingexporter/README.md
# * clickhouse - https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/clickhouseexporter
# * extensions - https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/healthcheckextension/README.md
###
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: clickhouse
namespace: telemetry
spec:
mode: deployment
config: |
receivers:
otlp:
protocols:
grpc:
processors:
batch:
timeout: 200ms
send_batch_size: 8192
exporters:
clickhouse:
endpoint: tcp://clickhouse:9000?dial_timeout=10s&compress=lz4
database: otel
username: default
password: default
ttl_days: 14
logs_table_name: otel_logs
traces_table_name: otel_traces
metrics_table_name: otel_metrics
timeout: 5s
retry_on_failure:
enabled: true
initial_interval: 5s
max_interval: 30s
max_elapsed_time: 300s
extensions:
health_check:
service:
telemetry:
logs:
level: debug
extensions: [health_check]
pipelines:
metrics:
receivers: [otlp]
exporters: [clickhouse]
processors: [batch]
traces:
receivers: [otlp]
exporters: [clickhouse]
processors: [batch]
logs:
receivers: [otlp]
exporters: [clickhouse]
processors: [batch]
6 changes: 6 additions & 0 deletions examples/otel_collector/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module "otel_collector_clickhouse" {
source = "cloud-labs-infra/manifest/kubernetes"
version = "1.0.0"

manifest = yamldecode(file("${path.module}/k8s/otel_collector_clickhouse.yaml"))
}
14 changes: 14 additions & 0 deletions examples/otel_collector/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
terraform {
required_version = "~> 1.4"

required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~>2.20"
}
}
}

provider "kubernetes" {
host = "https://127.0.0.1:443"
}

0 comments on commit 7b64093

Please sign in to comment.