Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SignalFx demo configuration #371

Merged
merged 6 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add SignalFx demo configuration
* collector.yaml
* k8s.yaml
  • Loading branch information
flands committed Jun 27, 2020
commit cd5785aa94ba7c0ebd82aee365037ff5764cb45f
75 changes: 75 additions & 0 deletions examples/signalfx/signalfx-collector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
extensions:
health_check:
zpages:
receivers:
otlp:
sapm:
signalfx:
# This section is used to collect OpenTelemetry metrics
flands marked this conversation as resolved.
Show resolved Hide resolved
# 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
processors:
batch:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add blank line after each component? Would help visually associate comments with components.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum is the lack of black lines so this can be pasted directly into the k8s config?

# 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be more readable if this one is together with batch at top

# 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]
flands marked this conversation as resolved.
Show resolved Hide resolved
processors: [memory_limiter, batch, queued_retry]
exporters: [sapm]
metrics:
receivers: [signalfx, prometheus, otlp]
processors: [memory_limiter, batch]
exporters: [signalfx]
extensions: [health_check, zpages]
179 changes: 179 additions & 0 deletions examples/signalfx/signalfx-k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
---
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
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]
flands marked this conversation as resolved.
Show resolved Hide resolved
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: signalfx # Default endpoint for SignalFx metrics receiver.
port: 9943
- name: metrics # Default endpoint for querying metrics.
flands marked this conversation as resolved.
Show resolved Hide resolved
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"
- "--new-metrics"
- "--legacy-metrics=false"
- "--add-instance-id"
image: otel/opentelemetry-collector-contrib:0.4.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: 9943 # Default endpoint for SignalFx metrics receiver.
- containerPort: 8888 # Default endpoint for querying metrics.
flands marked this conversation as resolved.
Show resolved Hide resolved
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