datadog

package
v1.9.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Datadog Plugin

The rigdev.datadog plugin adds Datadog specific tags to the Deployment and Pods of the capsule as requested here. It can enable/disable the execution of the Datadog Admission Controller on the pods and sets the necessary library and unified service tags.

The config can be templated with standard Go templating and has

.capsule

as its templating context.

Example

Config (in context of the rig-operator Helm values):

config:
  pipeline:
    steps:
      - plugins:
        - name: rigdev.datadog
          config: |
            libraryTag:
              java: v1.31.0
            unifiedServiceTags:
              env: my-env
              service: my-service
              versin: my-version

The resulting Deployment resource of the Capsule

kind: Deployment
metadata:
  ...
  labels:
		tags.datadoghq.com/env:     my-env,
		tags.datadoghq.com/service: my-service,
		tags.datadoghq.com/version: my-version,
spec:
  template:
    metadata:
      labels:
				admission.datadoghq.com/enabled: true,
				tags.datadoghq.com/env:          my-env,
				tags.datadoghq.com/service:      my-name,
				tags.datadoghq.com/version:     my-version,
      annotations:
				admission.datadoghq.com/java-lib.version: v1.31.0,
   ...

Config

Configuration for the datadog plugin

Field Description
dontAddEnabledAnnotation boolean DontAddEnabledAnnotation toggles if the pods should have an annotation allowing the Datadog Admission controller to modify them.
libraryTag LibraryTag LibraryTag defines configuration for which datadog libraries to inject into the pods.
unifiedServiceTags UnifiedServiceTags UnifiedServiceTags configures the values for the Unified Service datadog tags.
LibraryTag

LibraryTag defines configuration for which datadog libraries to let the admission controller inject into the pods The admission controller will inject libraries from a container with the specified tag if the field is set.

Field Description
java string Tag of the Java library container
javascript string Tag of the JavaScript library container
python string Tag of the Python library container
net string Tag of the .NET library container
ruby string Tag of the Ruby library container
UnifiedServiceTags

UnifiedServiceTags configures the values of the Unified Service datadog tags on both Deployment and Pods

Field Description
env string The env tag
service string The service tag
version string The version tag

Documentation

Overview

+groupName=plugins.rig.dev -- Only used for config doc generation

Index

Constants

View Source
const Name = "rigdev.datadog"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// DontAddEnabledAnnotation toggles if the pods should have an annotation
	// allowing the Datadog Admission controller to modify them.
	DontAddEnabledAnnotation bool `json:"dontAddEnabledAnnotation,omitempty"`
	// LibraryTag defines configuration for which datadog libraries to inject into the pods.
	LibraryTag LibraryTag `json:"libraryTag,omitempty"`
	// UnifiedServiceTags configures the values for the Unified Service datadog tags.
	UnifiedServiceTags UnifiedServiceTags `json:"unifiedServiceTags,omitempty"`
}

Configuration for the datadog plugin +kubebuilder:object:root=true

type LibraryTag

type LibraryTag struct {
	// Tag of the Java library container
	Java string `json:"java,omitempty"`
	// Tag of the JavaScript library container
	JavaScript string `json:"javascript,omitempty"`
	// Tag of the Python library container
	Python string `json:"python,omitempty"`
	// Tag of the .NET library container
	NET string `json:"net,omitempty"`
	// Tag of the Ruby library container
	Ruby string `json:"ruby,omitempty"`
}

LibraryTag defines configuration for which datadog libraries to let the admission controller inject into the pods The admission controller will inject libraries from a container with the specified tag if the field is set.

type Plugin

type Plugin struct {
	plugin.NoWatchObjectStatus
	// contains filtered or unexported fields
}

func (*Plugin) Initialize

func (d *Plugin) Initialize(req plugin.InitializeRequest) error

func (*Plugin) Run

func (d *Plugin) Run(_ context.Context, req pipeline.CapsuleRequest, _ hclog.Logger) error

type UnifiedServiceTags

type UnifiedServiceTags struct {
	// The env tag
	Env string `json:"env,omitempty"`
	// The service tag
	Service string `json:"service,omitempty"`
	// The version tag
	Version string `json:"version,omitempty"`
}

UnifiedServiceTags configures the values of the Unified Service datadog tags on both Deployment and Pods

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL