Skip to content

Commit

Permalink
add http opAMP support
Browse files Browse the repository at this point in the history
  • Loading branch information
smithclay committed Mar 6, 2024
1 parent e97062f commit 5a8bf27
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 23 deletions.
70 changes: 52 additions & 18 deletions collector/config-k8s/values-oteldemo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,70 @@ opentelemetry-collector:
config:
processors:
k8sattributes:
passthrough: false
filter:
node_from_env_var: K8S_NODE_NAME
pod_association:
# Pod assocations are used to extract a pod ID from one or more sources.
# These are used to match up telemetry.
# Each has a maximum of 4 association sources.
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: resource_attribute
name: k8s.pod.name
- from: resource_attribute
name: k8s.namespace.name
- from: resource_attribute
name: k8s.node.name
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.name
- from: resource_attribute
name: k8s.namespace.name
- sources:
- from: connection
extract:
labels:
- tag_name: service.name
key: app.kubernetes.io/name
from: pod
- tag_name: service.name
key: k8s-app
from: pod
- tag_name: k8s.app.instance
key: app.kubernetes.io/instance
from: pod
- tag_name: service.version
key: app.kubernetes.io/version
from: pod
- tag_name: k8s.app.component
key: app.kubernetes.io/component
from: pod
metadata:
- k8s.namespace.name
- k8s.pod.name
- k8s.pod.uid
- k8s.node.name
- k8s.pod.start_time
- k8s.deployment.name
- k8s.deployment.uid
- k8s.statefulset.name
- k8s.statefulset.uid
- k8s.replicaset.name
- k8s.replicaset.uid
- k8s.daemonset.name
- k8s.daemonset.uid
- k8s.cronjob.name
- k8s.job.name
- k8s.job.uid
- k8s.node.name
- k8s.pod.name
- k8s.pod.uid
- k8s.container.name
- k8s.cronjob.name
- k8s.statefulset.name
- k8s.statefulset.uid
- container.image.tag
- container.image.name
- k8s.pod.start_time
- k8s.cluster.uid
passthrough: false
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: connection
exporters:
debug:
verbosity: normal
Expand Down
2 changes: 1 addition & 1 deletion collector/config/otelcol-docker-hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extensions:
health_check:
opamp:
server:
ws:
http:
endpoint: https://opamp.lightstep.com/v1/opamp
headers:
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
Expand Down
2 changes: 1 addition & 1 deletion collector/config/otelcol-linux-hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extensions:
health_check:
opamp:
server:
ws:
http:
endpoint: https://opamp.lightstep.com/v1/opamp
headers:
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
Expand Down
5 changes: 4 additions & 1 deletion collector/config/otelcol-macos-hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ receivers:
- 0.0.0.0:8888
hostmetrics:
collection_interval: 5s
# cpu and disk not supported by macOS
scrapers:
# cpu and disk are only supported if build with CGO_ENABLED=1
# The ServiceNow collector goreleaser build does this, other builds may not.
cpu:
disk:
load:
processes:
filesystem:
Expand Down
2 changes: 1 addition & 1 deletion collector/config/otelcol-windows-hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extensions:
health_check:
opamp:
server:
ws:
http:
endpoint: https://opamp.lightstep.com/v1/opamp
headers:
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
Expand Down
2 changes: 1 addition & 1 deletion collector/otelcol-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dist:
description: ServiceNow-flavored OpenTelemetry Collector distro
output_path: ./otelcol-servicenow
otelcol_version: 0.96.0
version: 0.0.11
version: 0.0.12

exporters:
- gomod:
Expand Down
24 changes: 24 additions & 0 deletions docs/remote-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Remote Management with the ServiceNow Collector

Version `0.11.0` and later of the ServiceNow Collector contain the [`opamp` extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/opampextension).

The opAMP extension can be used to connect to an opAMP server for remote management, including Cloud Observability.

More information about the opAMP remote management protocol is available on the [OpenTelemetry community site](https://opentelemetry.io/docs/specs/opamp/).

### Connecting to Cloud Observability

By default, most default configuration files in release packages will be configured for opAMP. A ][special API Key](https://docs.lightstep.com/docs/create-and-manage-api-keys) is needed to connect to Cloud Observability's opAMP service.

The extension is configured via the `opamp` key under `extensions`. Below is an example:

```yaml
extensions:
health_check:
opamp:
server:
http:
endpoint: https://opamp.lightstep.com/v1/opamp
headers:
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
```

0 comments on commit 5a8bf27

Please sign in to comment.