From e0be22ac1e8cd49d52a132c36c3b7d98f7600ae6 Mon Sep 17 00:00:00 2001 From: Martin Divis Date: Thu, 2 Feb 2023 10:13:07 +0100 Subject: [PATCH] CRD defs for Apache HTTPD Autoinstrumentation (#1305) * CRD defs for Apache HTTPD Autoinstrumentation * Generated resources for Apache Httpd CRD defs * Generated bundle for Apache Httpd CRD * Fixed version for "make bundle" * Makefile and version update * Chngnd repo user to open-telemetry for make bundle * Reverted changes in kustomization.yaml * Reverted changes in kustomization.yaml * Reverted chnages in kustomization.yaml * Apache HTTPD - Link to attributes doc * make bundle sync * ./.chloggen yaml added for #1305 * Version fix --- .chloggen/1305-apache-httpd-crd.yaml | 16 + Makefile | 1 + apis/v1alpha1/instrumentation_types.go | 31 + apis/v1alpha1/instrumentation_webhook.go | 27 +- apis/v1alpha1/instrumentation_webhook_test.go | 10 +- apis/v1alpha1/zz_generated.deepcopy.go | 30 + .../opentelemetry.io_instrumentations.yaml | 250 ++++++++ .../opentelemetry.io_instrumentations.yaml | 250 ++++++++ docs/api.md | 554 ++++++++++++++++++ versions.txt | 4 + 10 files changed, 1163 insertions(+), 10 deletions(-) create mode 100644 .chloggen/1305-apache-httpd-crd.yaml diff --git a/.chloggen/1305-apache-httpd-crd.yaml b/.chloggen/1305-apache-httpd-crd.yaml new file mode 100644 index 0000000000..01d80814b0 --- /dev/null +++ b/.chloggen/1305-apache-httpd-crd.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action) +component: operator + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: This PR adds CRD for Apache HTTPD auto-instrumentation + +# One or more tracking issues related to the change +issues: [1305] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/Makefile b/Makefile index 6c5392e438..a2f1d5bdfa 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ AUTO_INSTRUMENTATION_JAVA_VERSION ?= "$(shell grep -v '\#' versions.txt | grep a AUTO_INSTRUMENTATION_NODEJS_VERSION ?= "$(shell grep -v '\#' versions.txt | grep autoinstrumentation-nodejs | awk -F= '{print $$2}')" AUTO_INSTRUMENTATION_PYTHON_VERSION ?= "$(shell grep -v '\#' versions.txt | grep autoinstrumentation-python | awk -F= '{print $$2}')" AUTO_INSTRUMENTATION_DOTNET_VERSION ?= "$(shell grep -v '\#' versions.txt | grep autoinstrumentation-dotnet | awk -F= '{print $$2}')" +AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION ?= "$(shell grep -v '\#' versions.txt | grep autoinstrumentation-apache-httpd | awk -F= '{print $$2}')" LD_FLAGS ?= "-X ${VERSION_PKG}.version=${VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.otelCol=${OTELCOL_VERSION} -X ${VERSION_PKG}.targetAllocator=${TARGETALLOCATOR_VERSION} -X ${VERSION_PKG}.autoInstrumentationJava=${AUTO_INSTRUMENTATION_JAVA_VERSION} -X ${VERSION_PKG}.autoInstrumentationNodeJS=${AUTO_INSTRUMENTATION_NODEJS_VERSION} -X ${VERSION_PKG}.autoInstrumentationPython=${AUTO_INSTRUMENTATION_PYTHON_VERSION} -X ${VERSION_PKG}.autoInstrumentationDotNet=${AUTO_INSTRUMENTATION_DOTNET_VERSION}" ARCH ?= $(shell go env GOARCH) diff --git a/apis/v1alpha1/instrumentation_types.go b/apis/v1alpha1/instrumentation_types.go index d4d00bece9..ee952e8ab0 100644 --- a/apis/v1alpha1/instrumentation_types.go +++ b/apis/v1alpha1/instrumentation_types.go @@ -58,6 +58,10 @@ type InstrumentationSpec struct { // DotNet defines configuration for DotNet auto-instrumentation. // +optional DotNet DotNet `json:"dotnet,omitempty"` + + // Apache defines configuration for Apache HTTPD auto-instrumentation. + // +optional + ApacheHttpd ApacheHttpd `json:"apacheHttpd,omitempty"` } // Resource defines the configuration for the resource attributes, as defined by the OpenTelemetry specification. @@ -145,6 +149,33 @@ type DotNet struct { Env []corev1.EnvVar `json:"env,omitempty"` } +type ApacheHttpd struct { + // Image is a container image with Apache SDK and auto-instrumentation. + // +optional + Image string `json:"image,omitempty"` + + // Env defines Apache HTTPD specific env vars. There are four layers for env vars' definitions and + // the precedence order is: `original container env vars` > `language specific env vars` > `common env vars` > `instrument spec configs' vars`. + // If the former var had been defined, then the other vars would be ignored. + // +optional + Env []corev1.EnvVar `json:"env,omitempty"` + + // Attrs defines Apache HTTPD agent specific attributes. The precedence is: + // `agent default attributes` > `instrument spec attributes` . + // Attributes are documented at https://github.com/open-telemetry/opentelemetry-cpp-contrib/tree/main/instrumentation/otel-webserver-module + // +optional + Attrs []corev1.EnvVar `json:"attrs,omitempty"` + + // Apache HTTPD server version. One of 2.4 or 2.2. Default is 2.4 + // +optional + Version string `json:"version,omitempty"` + + // Location of Apache HTTPD server configuration. + // Needed only if different from default "/usr/local/apache2/conf" + // +optional + ConfigPath string `json:"configPath,omitempty"` +} + // InstrumentationStatus defines status of the instrumentation. type InstrumentationStatus struct { } diff --git a/apis/v1alpha1/instrumentation_webhook.go b/apis/v1alpha1/instrumentation_webhook.go index 39ab6c8662..41a78f78f5 100644 --- a/apis/v1alpha1/instrumentation_webhook.go +++ b/apis/v1alpha1/instrumentation_webhook.go @@ -27,12 +27,13 @@ import ( ) const ( - AnnotationDefaultAutoInstrumentationJava = "instrumentation.opentelemetry.io/default-auto-instrumentation-java-image" - AnnotationDefaultAutoInstrumentationNodeJS = "instrumentation.opentelemetry.io/default-auto-instrumentation-nodejs-image" - AnnotationDefaultAutoInstrumentationPython = "instrumentation.opentelemetry.io/default-auto-instrumentation-python-image" - AnnotationDefaultAutoInstrumentationDotNet = "instrumentation.opentelemetry.io/default-auto-instrumentation-dotnet-image" - envPrefix = "OTEL_" - envSplunkPrefix = "SPLUNK_" + AnnotationDefaultAutoInstrumentationJava = "instrumentation.opentelemetry.io/default-auto-instrumentation-java-image" + AnnotationDefaultAutoInstrumentationNodeJS = "instrumentation.opentelemetry.io/default-auto-instrumentation-nodejs-image" + AnnotationDefaultAutoInstrumentationPython = "instrumentation.opentelemetry.io/default-auto-instrumentation-python-image" + AnnotationDefaultAutoInstrumentationDotNet = "instrumentation.opentelemetry.io/default-auto-instrumentation-dotnet-image" + AnnotationDefaultAutoInstrumentationApacheHttpd = "instrumentation.opentelemetry.io/default-auto-instrumentation-apache-httpd-image" + envPrefix = "OTEL_" + envSplunkPrefix = "SPLUNK_" ) // log is for logging in this package. @@ -78,6 +79,17 @@ func (r *Instrumentation) Default() { r.Spec.DotNet.Image = val } } + if r.Spec.ApacheHttpd.Image == "" { + if val, ok := r.Annotations[AnnotationDefaultAutoInstrumentationApacheHttpd]; ok { + r.Spec.ApacheHttpd.Image = val + } + } + if r.Spec.ApacheHttpd.Version == "" { + r.Spec.ApacheHttpd.Version = "2.4" + } + if r.Spec.ApacheHttpd.ConfigPath == "" { + r.Spec.ApacheHttpd.ConfigPath = "/usr/local/apache2/conf" + } } // +kubebuilder:webhook:verbs=create;update,path=/validate-opentelemetry-io-v1alpha1-instrumentation,mutating=false,failurePolicy=fail,groups=opentelemetry.io,resources=instrumentations,versions=v1alpha1,name=vinstrumentationcreateupdate.kb.io,sideEffects=none,admissionReviewVersions=v1 @@ -134,6 +146,9 @@ func (r *Instrumentation) validate() error { if err := r.validateEnv(r.Spec.DotNet.Env); err != nil { return err } + if err := r.validateEnv(r.Spec.ApacheHttpd.Env); err != nil { + return err + } return nil } diff --git a/apis/v1alpha1/instrumentation_webhook_test.go b/apis/v1alpha1/instrumentation_webhook_test.go index ef31be3f84..f390443b48 100644 --- a/apis/v1alpha1/instrumentation_webhook_test.go +++ b/apis/v1alpha1/instrumentation_webhook_test.go @@ -25,10 +25,11 @@ func TestInstrumentationDefaultingWebhook(t *testing.T) { inst := &Instrumentation{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ - AnnotationDefaultAutoInstrumentationJava: "java-img:1", - AnnotationDefaultAutoInstrumentationNodeJS: "nodejs-img:1", - AnnotationDefaultAutoInstrumentationPython: "python-img:1", - AnnotationDefaultAutoInstrumentationDotNet: "dotnet-img:1", + AnnotationDefaultAutoInstrumentationJava: "java-img:1", + AnnotationDefaultAutoInstrumentationNodeJS: "nodejs-img:1", + AnnotationDefaultAutoInstrumentationPython: "python-img:1", + AnnotationDefaultAutoInstrumentationDotNet: "dotnet-img:1", + AnnotationDefaultAutoInstrumentationApacheHttpd: "apache-httpd-img:1", }, }, } @@ -37,6 +38,7 @@ func TestInstrumentationDefaultingWebhook(t *testing.T) { assert.Equal(t, "nodejs-img:1", inst.Spec.NodeJS.Image) assert.Equal(t, "python-img:1", inst.Spec.Python.Image) assert.Equal(t, "dotnet-img:1", inst.Spec.DotNet.Image) + assert.Equal(t, "apache-httpd-img:1", inst.Spec.ApacheHttpd.Image) } func TestInstrumentationValidatingWebhook(t *testing.T) { diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index 3aba6ad2e1..9b0df017e8 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -26,6 +26,35 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApacheHttpd) DeepCopyInto(out *ApacheHttpd) { + *out = *in + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]v1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Attrs != nil { + in, out := &in.Attrs, &out.Attrs + *out = make([]v1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApacheHttpd. +func (in *ApacheHttpd) DeepCopy() *ApacheHttpd { + if in == nil { + return nil + } + out := new(ApacheHttpd) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AutoscalerSpec) DeepCopyInto(out *AutoscalerSpec) { *out = *in @@ -219,6 +248,7 @@ func (in *InstrumentationSpec) DeepCopyInto(out *InstrumentationSpec) { in.NodeJS.DeepCopyInto(&out.NodeJS) in.Python.DeepCopyInto(&out.Python) in.DotNet.DeepCopyInto(&out.DotNet) + in.ApacheHttpd.DeepCopyInto(&out.ApacheHttpd) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstrumentationSpec. diff --git a/bundle/manifests/opentelemetry.io_instrumentations.yaml b/bundle/manifests/opentelemetry.io_instrumentations.yaml index d5a8147119..592686083a 100644 --- a/bundle/manifests/opentelemetry.io_instrumentations.yaml +++ b/bundle/manifests/opentelemetry.io_instrumentations.yaml @@ -53,6 +53,256 @@ spec: description: InstrumentationSpec defines the desired state of OpenTelemetry SDK and instrumentation. properties: + apacheHttpd: + description: Apache defines configuration for Apache HTTPD auto-instrumentation. + properties: + attrs: + description: 'Attrs defines Apache HTTPD agent specific attributes. + The precedence is: `agent default attributes` > `instrument + spec attributes` . Attributes are documented at https://github.com/open-telemetry/opentelemetry-cpp-contrib/tree/main/instrumentation/otel-webserver-module' + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a + C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. If + a variable cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced to a single + $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + configPath: + description: Location of Apache HTTPD server configuration. Needed + only if different from default "/usr/local/apache2/conf" + type: string + env: + description: 'Env defines Apache HTTPD specific env vars. There + are four layers for env vars'' definitions and the precedence + order is: `original container env vars` > `language specific + env vars` > `common env vars` > `instrument spec configs'' vars`. + If the former var had been defined, then the other vars would + be ignored.' + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a + C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. If + a variable cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced to a single + $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + image: + description: Image is a container image with Apache SDK and auto-instrumentation. + type: string + version: + description: Apache HTTPD server version. One of 2.4 or 2.2. Default + is 2.4 + type: string + type: object dotnet: description: DotNet defines configuration for DotNet auto-instrumentation. properties: diff --git a/config/crd/bases/opentelemetry.io_instrumentations.yaml b/config/crd/bases/opentelemetry.io_instrumentations.yaml index ba2ad97b84..20697e796c 100644 --- a/config/crd/bases/opentelemetry.io_instrumentations.yaml +++ b/config/crd/bases/opentelemetry.io_instrumentations.yaml @@ -52,6 +52,256 @@ spec: description: InstrumentationSpec defines the desired state of OpenTelemetry SDK and instrumentation. properties: + apacheHttpd: + description: Apache defines configuration for Apache HTTPD auto-instrumentation. + properties: + attrs: + description: 'Attrs defines Apache HTTPD agent specific attributes. + The precedence is: `agent default attributes` > `instrument + spec attributes` . Attributes are documented at https://github.com/open-telemetry/opentelemetry-cpp-contrib/tree/main/instrumentation/otel-webserver-module' + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a + C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. If + a variable cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced to a single + $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + configPath: + description: Location of Apache HTTPD server configuration. Needed + only if different from default "/usr/local/apache2/conf" + type: string + env: + description: 'Env defines Apache HTTPD specific env vars. There + are four layers for env vars'' definitions and the precedence + order is: `original container env vars` > `language specific + env vars` > `common env vars` > `instrument spec configs'' vars`. + If the former var had been defined, then the other vars would + be ignored.' + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a + C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. If + a variable cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced to a single + $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + image: + description: Image is a container image with Apache SDK and auto-instrumentation. + type: string + version: + description: Apache HTTPD server version. One of 2.4 or 2.2. Default + is 2.4 + type: string + type: object dotnet: description: DotNet defines configuration for DotNet auto-instrumentation. properties: diff --git a/docs/api.md b/docs/api.md index 00f6922f14..7329db833d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -86,6 +86,13 @@ InstrumentationSpec defines the desired state of OpenTelemetry SDK and instrumen + apacheHttpd + object + + Apache defines configuration for Apache HTTPD auto-instrumentation.
+ + false + dotnet object @@ -152,6 +159,553 @@ InstrumentationSpec defines the desired state of OpenTelemetry SDK and instrumen +### Instrumentation.spec.apacheHttpd +[↩ Parent](#instrumentationspec) + + + +Apache defines configuration for Apache HTTPD auto-instrumentation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
attrs[]object + Attrs defines Apache HTTPD agent specific attributes. The precedence is: `agent default attributes` > `instrument spec attributes` . Attributes are documented at https://github.com/open-telemetry/opentelemetry-cpp-contrib/tree/main/instrumentation/otel-webserver-module
+
false
configPathstring + Location of Apache HTTPD server configuration. Needed only if different from default "/usr/local/apache2/conf"
+
false
env[]object + Env defines Apache HTTPD specific env vars. There are four layers for env vars' definitions and the precedence order is: `original container env vars` > `language specific env vars` > `common env vars` > `instrument spec configs' vars`. If the former var had been defined, then the other vars would be ignored.
+
false
imagestring + Image is a container image with Apache SDK and auto-instrumentation.
+
false
versionstring + Apache HTTPD server version. One of 2.4 or 2.2. Default is 2.4
+
false
+ + +### Instrumentation.spec.apacheHttpd.attrs[index] +[↩ Parent](#instrumentationspecapachehttpd) + + + +EnvVar represents an environment variable present in a Container. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring + Name of the environment variable. Must be a C_IDENTIFIER.
+
true
valuestring + Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".
+
false
valueFromobject + Source for the environment variable's value. Cannot be used if value is not empty.
+
false
+ + +### Instrumentation.spec.apacheHttpd.attrs[index].valueFrom +[↩ Parent](#instrumentationspecapachehttpdattrsindex) + + + +Source for the environment variable's value. Cannot be used if value is not empty. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
configMapKeyRefobject + Selects a key of a ConfigMap.
+
false
fieldRefobject + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
+
false
resourceFieldRefobject + Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
+
false
secretKeyRefobject + Selects a key of a secret in the pod's namespace
+
false
+ + +### Instrumentation.spec.apacheHttpd.attrs[index].valueFrom.configMapKeyRef +[↩ Parent](#instrumentationspecapachehttpdattrsindexvaluefrom) + + + +Selects a key of a ConfigMap. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
keystring + The key to select.
+
true
namestring + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
+
false
optionalboolean + Specify whether the ConfigMap or its key must be defined
+
false
+ + +### Instrumentation.spec.apacheHttpd.attrs[index].valueFrom.fieldRef +[↩ Parent](#instrumentationspecapachehttpdattrsindexvaluefrom) + + + +Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
fieldPathstring + Path of the field to select in the specified API version.
+
true
apiVersionstring + Version of the schema the FieldPath is written in terms of, defaults to "v1".
+
false
+ + +### Instrumentation.spec.apacheHttpd.attrs[index].valueFrom.resourceFieldRef +[↩ Parent](#instrumentationspecapachehttpdattrsindexvaluefrom) + + + +Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
resourcestring + Required: resource to select
+
true
containerNamestring + Container name: required for volumes, optional for env vars
+
false
divisorint or string + Specifies the output format of the exposed resources, defaults to "1"
+
false
+ + +### Instrumentation.spec.apacheHttpd.attrs[index].valueFrom.secretKeyRef +[↩ Parent](#instrumentationspecapachehttpdattrsindexvaluefrom) + + + +Selects a key of a secret in the pod's namespace + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
keystring + The key of the secret to select from. Must be a valid secret key.
+
true
namestring + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
+
false
optionalboolean + Specify whether the Secret or its key must be defined
+
false
+ + +### Instrumentation.spec.apacheHttpd.env[index] +[↩ Parent](#instrumentationspecapachehttpd) + + + +EnvVar represents an environment variable present in a Container. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring + Name of the environment variable. Must be a C_IDENTIFIER.
+
true
valuestring + Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".
+
false
valueFromobject + Source for the environment variable's value. Cannot be used if value is not empty.
+
false
+ + +### Instrumentation.spec.apacheHttpd.env[index].valueFrom +[↩ Parent](#instrumentationspecapachehttpdenvindex) + + + +Source for the environment variable's value. Cannot be used if value is not empty. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
configMapKeyRefobject + Selects a key of a ConfigMap.
+
false
fieldRefobject + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
+
false
resourceFieldRefobject + Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
+
false
secretKeyRefobject + Selects a key of a secret in the pod's namespace
+
false
+ + +### Instrumentation.spec.apacheHttpd.env[index].valueFrom.configMapKeyRef +[↩ Parent](#instrumentationspecapachehttpdenvindexvaluefrom) + + + +Selects a key of a ConfigMap. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
keystring + The key to select.
+
true
namestring + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
+
false
optionalboolean + Specify whether the ConfigMap or its key must be defined
+
false
+ + +### Instrumentation.spec.apacheHttpd.env[index].valueFrom.fieldRef +[↩ Parent](#instrumentationspecapachehttpdenvindexvaluefrom) + + + +Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
fieldPathstring + Path of the field to select in the specified API version.
+
true
apiVersionstring + Version of the schema the FieldPath is written in terms of, defaults to "v1".
+
false
+ + +### Instrumentation.spec.apacheHttpd.env[index].valueFrom.resourceFieldRef +[↩ Parent](#instrumentationspecapachehttpdenvindexvaluefrom) + + + +Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
resourcestring + Required: resource to select
+
true
containerNamestring + Container name: required for volumes, optional for env vars
+
false
divisorint or string + Specifies the output format of the exposed resources, defaults to "1"
+
false
+ + +### Instrumentation.spec.apacheHttpd.env[index].valueFrom.secretKeyRef +[↩ Parent](#instrumentationspecapachehttpdenvindexvaluefrom) + + + +Selects a key of a secret in the pod's namespace + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
keystring + The key of the secret to select from. Must be a valid secret key.
+
true
namestring + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
+
false
optionalboolean + Specify whether the Secret or its key must be defined
+
false
+ + ### Instrumentation.spec.dotnet [↩ Parent](#instrumentationspec) diff --git a/versions.txt b/versions.txt index 8bf0d08d9d..88aa144d1b 100644 --- a/versions.txt +++ b/versions.txt @@ -25,3 +25,7 @@ autoinstrumentation-python=0.36b0 # Represents the current release of DotNet instrumentation. # Should match autoinstrumentation/dotnet/version.txt autoinstrumentation-dotnet=0.5.0 + +# Represents the current release of Apache HTTPD instrumentation. +# Should match autoinstrumentation/apache-httpd/version.txt +autoinstrumentation-apache-httpd=1.0.2