Skip to content

signalfx/splunk-otel-collector-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠ WARNING: This project is Alpha.

Please do not use in production. Things will break without notice.


Splunk OpenTelemetry Collector Operator for Kubernetes

The OpenTelemetry Operator is an implementation of a Kubernetes Operator.

It helps deploy and manage Splunk OpenTelemetry Collector

Getting started

1. If cert-manager is not already deployed and available to this operator, then deploy it.

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.2/cert-manager.yaml

The cert-manager adds certificates and certificate issuers as resource types in Kubernetes clusters, and simplifies the process of obtaining, renewing and using those certificates.

2. Deploy the Operator

2.a Kubernetes

kubectl apply -f https://github.com/signalfx/splunk-otel-collector-operator/releases/latest/download/splunk-otel-operator.yaml  

2.b OpenShift

kubectl apply -f https://github.com/signalfx/splunk-otel-collector-operator/releases/latest/download/splunk-otel-operator-openshift.yaml  

3. Add your Splunk token

kubectl create secret generic splunk-access-token --namespace splunk-otel-operator-system --from-literal=access-token=SPLUNK_ACCESS_TOKEN  

A new users could obtain a token by starting a Splunk Observability trial and following these steps for creating a token.

4. Deploy the Splunk OpenTelemetry Collector

Once the splunk-otel-operator deployment is ready, create a Splunk OpenTelemetry Collector instance:

$ kubectl apply -f - <<EOF  
apiVersion: otel.splunk.com/v1alpha1  
kind: Agent  
metadata:  
  name: splunk-otel  
  namespace: splunk-otel-operator-system  
spec:  
  clusterName: <MY_CLUSTER_NAME>  
  realm: <SPLUNK_REALM>  
EOF  

Replace MY_CLUSTER_NAME and SPLUNK_REALM with your values.

4. Verify the cert-manager, operator, and collector are up and running properly.

kubectl get pods -n cert-manager
NAME                                       READY   STATUS    RESTARTS   AGE
cert-manager-7c9c58cbcb-jwwkk              1/1     Running   0          5m1s
cert-manager-cainjector-5d88544c9c-chwhr   1/1     Running   0          5m1s
cert-manager-webhook-85f88ffb5b-4hrpb      1/1     Running   0          5m1s
kubectl get pods -n splunk-otel-operator-system
NAME                                                       READY   STATUS    RESTARTS   AGE
splunk-otel-agent-pp8wn                                    1/1     Running   0          68s
splunk-otel-cluster-receiver-8f666b5b8-wbncp               1/1     Running   0          68s
splunk-otel-operator-controller-manager-67b86fcf5c-f2sqq   1/1     Running   0          3m38s

WARNING: Until the OpenTelemetry Collector format is stable, changes may be required in the above example to remain
compatible with the latest version of the Splunk OpenTelemetry Operator and Splunk OpenTelemetry Collector.

Automatically instrumenting k8s pods

This operator can automatically inject configuration and instrumentation agents into Kubernetes pods on demand. In order to do so, you'll need to annotate the pods you want to instrument or auto-configure. For example, if your deployment looks like the following:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-java-app
spec:
  template:
    spec:
      containers:
      - name: my-java-app
        image: my-java-app:latest

Then you can automatically instrument it by adding otel.splunk.com/inject-java: "true" to the Pod spec (not the deployment) so that it would look like the following:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-java-app
spec:
  template:
    metadata:
      annotations:
        otel.splunk.com/inject-java: "true"
    spec:
      containers:
      - name: my-java-app
        image: my-java-app:latest

This will automatically inject Splunk OpenTelemetry Java Agent into the pod and configure it to send telemetry to the OpenTelemetry agents deployed by the operator.

Right now the following annotations are supported:

  • otel.splunk.com/inject-java

When this instrumentation is set to "true" on a pod, the operator automatically instruments the pod with the Splunk OpenTelemetry Java agent and configures it to send all telemetry data to the OpenTelemetry agents managed by the operator.

  • otel.splunk.com/inject-config

When this instrumentation is set to "true" on a pod, the operator only configures the pod to send all telemetry data to the OpenTelemetry agents managed by the operator. Pods are not instrumented in this case and that is left to the user.

Automatic Instrumentation Examples:

Compatibility matrix

OpenTelemetry Operator vs. Kubernetes

We strive to be compatible with the widest range of Kubernetes versions as possible, but some changes to Kubernetes itself require us to break compatibility with older Kubernetes versions, be it because of code incompatibilities, or in the name of maintainability.

Our promise is that we'll follow what's common practice in the Kubernetes world and support N-2 versions, based on the release date of the OpenTelemetry Operator.

The Splunk OpenTelemetry Collector Operator might work on versions outside of the given range, but when opening new issues, please make sure to test your scenario on a supported version.

Operator Kubernetes
v0.0.3 v1.20 to v1.23
v0.0.4 v1.23 to v1.25
v0.0.5 v1.23 to v1.25
v0.0.6 v1.23 to v1.25

License

Apache 2.0 License.

ℹ️  SignalFx was acquired by Splunk in October 2019. See Splunk SignalFx for more information.