Skip to content

Commit

Permalink
Add SignalFx demo configuration (#371)
Browse files Browse the repository at this point in the history
* Add SignalFx demo configuration

* collector.yaml
* k8s.yaml

* Update signalfx-k8s.yaml

* Enable Zipkin for Istio Mixer Adapter

* Update examples/signalfx/signalfx-collector.yaml

Co-authored-by: Paulo Janotti <[email protected]>

* Update examples/signalfx/signalfx-k8s.yaml

Co-authored-by: Paulo Janotti <[email protected]>

* Move to exporter directory

Co-authored-by: Paulo Janotti <[email protected]>
  • Loading branch information
2 people authored and wyTrivail committed Jul 13, 2020
1 parent 520aa99 commit 1ef4814
Show file tree
Hide file tree
Showing 2 changed files with 260 additions and 0 deletions.
78 changes: 78 additions & 0 deletions exporter/sapmexporter/examples/signalfx-collector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
extensions:
health_check:
zpages:
receivers:
otlp:
sapm:
signalfx:
# This section is used to collect the OpenTelemetry Collector metrics
# Even if just a SignalFx µAPM customer, these metrics are included
prometheus:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['localhost:8888']
# If you want to use the environment filter
# In the SignalFx dashboard
#labels:
#environment: demo
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '.*grpc_io.*'
action: drop
# Enable Zipkin to support Istio Mixer Adapter
# https://github.com/signalfx/signalfx-istio-adapter
zipkin:
processors:
batch:
# Optional: If you have a different environment tag name
# If this option is enabled it must be added to the pipeline section below
#attributes/copyfromexistingkey:
#actions:
#- key: environment
#from_attribute: YOUR_EXISTING_TAG_NAMEE
#action: upsert
# Optional: If you want to add an environment tag
# If this option is enabled it must be added to the pipeline section below
#attributes/newenvironment:
#actions:
#- key: environment
#value: "YOUR_ENVIRONMENT_NAME"
#action: insert
queued_retry:
# Enabling the memory_limiter is strongly recommended for every pipeline.
# Configuration is based on the amount of memory allocated to the collector.
# The configuration below assumes 2GB of memory. In general, the ballast
# should be set to 1/3 of the collector's memory, the limit should be 90% of
# the collector's memory up to 2GB, and the spike should be 25% of the
# collector's memory up to 2GB. In addition, the "--mem-ballast-size-mib" CLI
# flag must be set to the same value as the "ballast_size_mib". For more
# information, see
# https://github.com/open-telemetry/opentelemetry-collector/blob/master/processor/memorylimiter/README.md
memory_limiter:
ballast_size_mib: 683
check_interval: 2s
limit_mib: 1800
spike_limit_mib: 500
exporters:
# Traces
sapm:
access_token: "YOUR_ACCESS_TOKEN"
endpoint: "https://ingest.YOUR_SIGNALFX_REALM.signalfx.com/v2/trace"
# Metrics
signalfx:
access_token: "YOUR_ACCESS_TOKEN"
realm: "YOUR_SIGNALFX_REALM"
service:
pipelines:
traces:
receivers: [sapm, otlp, zipkin]
processors: [memory_limiter, batch, queued_retry]
exporters: [sapm]
metrics:
receivers: [signalfx, prometheus, otlp]
processors: [memory_limiter, batch]
exporters: [signalfx]
extensions: [health_check, zpages]
182 changes: 182 additions & 0 deletions exporter/sapmexporter/examples/signalfx-k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-conf
labels:
app: opentelemetry
component: otel-collector-conf
data:
otel-collector-config: |
extensions:
health_check:
zpages:
receivers:
otlp:
sapm:
signalfx:
# This section is used to collect OpenTelemetry metrics
# Even if just a SignalFx µAPM customer, these metrics are included
prometheus:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['localhost:8888']
# If you want to use the environment filter
# In the SignalFx dashboard
#labels:
#environment: demo
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '.*grpc_io.*'
action: drop
# Enable Zipkin to support Istio Mixer Adapter
# https://github.com/signalfx/signalfx-istio-adapter
zipkin:
processors:
batch:
# Optional: If you have a different environment tag name
# If this option is enabled it must be added to the pipeline section below
#attributes/copyfromexistingkey:
#actions:
#- key: environment
#from_attribute: YOUR_EXISTING_TAG_NAMEE
#action: upsert
# Optional: If you want to add an environment tag
# If this option is enabled it must be added to the pipeline section below
#attributes/newenvironment:
#actions:
#- key: environment
#value: "YOUR_ENVIRONMENT_NAME"
#action: insert
queued_retry:
# Enabling the memory_limiter is strongly recommended for every pipeline.
# Configuration is based on the amount of memory allocated to the collector.
# The configuration below assumes 2GB of memory. In general, the ballast
# should be set to 1/3 of the collector's memory, the limit should be 90% of
# the collector's memory up to 2GB, and the spike should be 25% of the
# collector's memory up to 2GB. In addition, the "--mem-ballast-size-mib" CLI
# flag must be set to the same value as the "ballast_size_mib". For more
# information, see
# https://github.com/open-telemetry/opentelemetry-collector/blob/master/processor/memorylimiter/README.md
memory_limiter:
ballast_size_mib: 683
check_interval: 2s
limit_mib: 1800
spike_limit_mib: 500
exporters:
# Traces
sapm:
access_token: "YOUR_ACCESS_TOKEN"
endpoint: "https://ingest.YOUR_SIGNALFX_REALM.signalfx.com/v2/trace"
# Metrics
signalfx:
access_token: "YOUR_ACCESS_TOKEN"
realm: "YOUR_SIGNALFX_REALM"
service:
pipelines:
traces:
receivers: [sapm, otlp, zipkin]
processors: [memory_limiter, batch, queued_retry]
exporters: [sapm]
metrics:
receivers: [signalfx, prometheus, otlp]
processors: [memory_limiter, batch]
exporters: [signalfx]
---
apiVersion: v1
kind: Service
metadata:
name: otel-collector
labels:
app: opentelemetry
component: otel-collector
spec:
ports:
- name: otlp # Default endpoint for OpenTelemetry receiver.
port: 55680
protocol: TCP
targetPort: 55680
- name: sapm # Default endpoint for SignalFx APM receiver.
port: 7276
- name: zipkin # Default endpoint for Zipkin trace receiver.
port: 9411
- name: signalfx # Default endpoint for SignalFx metrics receiver.
port: 9943
- name: metrics # Default endpoint for the Collector metrics.
port: 8888
selector:
component: otel-collector
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
labels:
app: opentelemetry
component: otel-collector
spec:
selector:
matchLabels:
app: opentelemetry
component: otel-collector
minReadySeconds: 5
progressDeadlineSeconds: 120
replicas: 1 #TODO - adjust this to your own requirements
template:
metadata:
labels:
app: opentelemetry
component: otel-collector
spec:
containers:
- command:
- "/otelcolcontrib"
- "--config=/conf/otel-collector-config.yaml"
# Memory Ballast size should be max 1/3 to 1/2 of memory.
- "--mem-ballast-size-mib=683"
image: otel/opentelemetry-collector-contrib:0.5.0
name: otel-collector
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 200m
memory: 400Mi
ports:
- containerPort: 55679 # Default endpoint for ZPages.
- containerPort: 55680 # Default endpoint for OpenTelemetry receiver.
- containerPort: 7276 # Default endpoint for SignalFx APM receiver.
- containerPort: 9411 # Default endpoint for Zipkin trace receiver.
- containerPort: 9943 # Default endpoint for SignalFx metrics receiver.
- containerPort: 8888 # Default endpoint for querying metrics.
volumeMounts:
- name: otel-collector-config-vol
mountPath: /conf
# - name: otel-collector-secrets
# mountPath: /secrets
livenessProbe:
httpGet:
path: /
port: 13133 # Health Check extension default port.
readinessProbe:
httpGet:
path: /
port: 13133 # Health Check extension default port.
volumes:
- configMap:
name: otel-collector-conf
items:
- key: otel-collector-config
path: otel-collector-config.yaml
name: otel-collector-config-vol
# - secret:
# name: otel-collector-secrets
# items:
# - key: cert.pem
# path: cert.pem
# - key: key.pem
# path: key.pem

0 comments on commit 1ef4814

Please sign in to comment.