-
Notifications
You must be signed in to change notification settings - Fork 15
Update Open Telemetry documentation #1604
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0f24486
Update and improve OpenTelemetry documentation
rb3ckers edaf31e
STAC-22435 Review comments and fixes after testing
rb3ckers f0172da
STAC-22435 Document otlp http properly
rb3ckers 67c5dcc
STAC-22435 Fixing otelcol-contrib setup for linux
rb3ckers 9714f86
STAC-22435 Fixing all the typos
rb3ckers 0336172
STAC-22435 Update lambda docs
rb3ckers e8a7d1d
STAC-22435 Add next steps to getting started
rb3ckers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
.gitbook/assets/otel/aws_nodejs_otel_proxy_collector_configuration.svg
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| --- | ||
| description: SUSE Observability | ||
| --- | ||
|
|
||
| # Open Telemetry concepts | ||
|
|
||
| This is a summary of the most important concepts in Open Telemetry and should be sufficient to get started. For a more detailed introduction use the [Open Telemetry documentation](https://opentelemetry.io/docs/concepts/) | ||
|
|
||
| ## Signals | ||
|
|
||
| Open Telemetry recognizes 3 telemetry signals: | ||
|
|
||
| * Traces | ||
| * Metrics | ||
| * Logs | ||
|
|
||
| At the momemt SUSE Observability supports traces and metrics, logs will be supported in a future version. For Kubernetes logs it is possible to use the [SUSE Observability agent](/k8s-quick-start-guide.md) instead. | ||
|
|
||
| ### Traces | ||
|
|
||
| Traces allow us to visualize the path of a request through your application. A trace consists of one or more spans that together form a tree, a single trace can be entirely within a single service, but it can also go across many services. Each span represents an operation in the processing of the request and has: | ||
| * a name | ||
| * start and end time, from that a duration can be calculated | ||
| * status | ||
| * attributes | ||
| * resource attributes (see [resources](#resources)) | ||
| * events | ||
|
|
||
| Span attributes are used to provide metadata for the span, for example a span that for an operation that places an order can have the `orderId` as an attribute, or a span for an HTTP operation can have the HTTP method and URL as attributes. | ||
|
|
||
| Span events can be used to represent a point in time where something important happened within the operation of the span. For example if the span failed there can be an `exception` or an `error` event that captures the error message, a stacktrace and the exact point in time the error occurred. | ||
|
|
||
| ### Metrics | ||
|
|
||
| Metrics are measurements captured at runtime and they result in a metric event. Metrics are important indicators for application performance and availability and are often used to alert on an outage or performance problem. Metrics have: | ||
| * a name | ||
| * a timestamp | ||
| * a kind (counter, gauge, histogram, etc.) | ||
| * attributes | ||
| * resource attributes (see [resources](#resources)) | ||
|
|
||
| Attributes provide the metadata for a metric. | ||
|
|
||
| ## Resources | ||
|
|
||
| A resource is the entity that produces the telemetry data. The resource attributes provide the metadata for the resource. For example a process running in a container, in a pod, in a namespace in a Kubernetes cluster can have resource attributes for all these entities. | ||
|
|
||
| Resource attributes are often automatically assigned by the SDKs. However it is recommended to always set the `service.name` and `service.namespace` attributes explicitly. The first one is the logical name for the service, if not set the SDK will set an `unknown_service` value making it very hard to use the data later in SUSE Observability. The namespace is a convenient way to organize your services, especially useful if you have the same services running in multiple locations. | ||
|
|
||
| ## Semantic conventions | ||
|
|
||
| Open Telemetry defines common names for operations and data, they call this the semantic conventions. Semantic conventions follow a naming scheme that allows for standardizing processing of data across languages, libraries and code bases. There are semantic conventions for all signals and for resource attributes. They are defined for many different platforms and operations on the [Open Telemetry website](https://opentelemetry.io/docs/specs/semconv/attributes-registry/). SDKs make use of the semantic conventions to assign these attributes and SUSE Observability also respects the conventions and relies on them, for example to recognize Kubernetes resources. | ||
|
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| description: SUSE Observability | ||
| --- | ||
|
|
||
| # Getting started | ||
|
|
||
| You might first want to familiarize yourself with the Open Telemetry [terminology and concepts](../concepts.md). like, signals, resources, etc. | ||
|
|
||
| To get started monitoring one of your own applications follow the getting started guide that matches best with your deployment setup: | ||
| * [Kubernetes or Rancher](./getting-started-k8s.md) | ||
| * [Linux host](./getting-started-linux.md) | ||
| * [AWS Lambda functions](./getting-started-lambda.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| --- | ||
| description: SUSE Observability | ||
| --- | ||
|
|
||
| # Getting Started with Open Telemetry on Rancher / Kubernetes | ||
|
|
||
| Here is the setup we'll be creating, for an application that needs to be monitored: | ||
|
|
||
| * The monitored application / workload running in cluster A | ||
| * The Open Telemetry collector running near the observed application(s), so in cluster A, and sending the data to SUSE Observability | ||
| * SUSE Observability running in cluster B, or SUSE Cloud Observability | ||
|
|
||
|  | ||
|
|
||
|
|
||
| ## The Open Telemetry collector | ||
|
|
||
| {% hint type="info" %} | ||
| For a production setup it is strongly recommended to install the collector, since it allows your service to offload data quickly and the collector can take care of additional handling like retries, batching, encryption or even sensitive data filtering. | ||
| {% endhint %} | ||
|
|
||
| First we'll install the OTel (Open Telemetry) collector in cluster A. We configure it to: | ||
|
|
||
| * Receive data from, potentially many, instrumented applications | ||
| * Enrich collected data with Kubernetes attributes | ||
| * Generate metrics for traces | ||
| * Forward the data to SUSE Observability, including authentication using the API key | ||
|
|
||
| Next to that it will also retry sending data when there are connection problems. | ||
|
|
||
| ### Create the namespace and a secret for the API key | ||
|
|
||
| We'll install in the `open-telemetry` namespace and use the receiver API key generated during installation (see [here](/use/security/k8s-ingestion-api-keys.md#api-keys) where to find it): | ||
|
|
||
| ```bash | ||
| kubectl create namespace open-telemetry | ||
| kubectl create secret generic open-telemetry-collector \ | ||
| --namespace open-telemetry \ | ||
| --from-literal=API_KEY='<suse-observability-api-key>' | ||
| ``` | ||
|
|
||
| ### Configure and install the collector | ||
|
|
||
| We install the collector with a Helm chart provided by the Open Telemetry project. Make sure you have the Open Telemetry helm charts repository configured: | ||
|
|
||
| ```bash | ||
| helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts | ||
| ``` | ||
|
|
||
| Create a `otel-collector.yaml` values file for the Helm chart. Here is a good starting point for usage with SUSE Observability, replace `<otlp-suse-observability-endpoint>` with your OTLP endpoint (see [OTLP API](../otlp-apis.md) for your endpoint) and insert the name for your Kubernetes cluster instead of `<your-cluster-name>`: | ||
|
|
||
| {% code title="otel-collector.yaml" lineNumbers="true" %} | ||
| ```yaml | ||
| # Set the API key from the secret as an env var: | ||
| extraEnvsFrom: | ||
| - secretRef: | ||
| name: open-telemetry-collector | ||
| mode: deployment | ||
| image: | ||
| # Use the collector container image that has all components important for k8s. In case of missing components the otel/opentelemetry-collector-contrib image can be used which | ||
| # has all components in the contrib repository: https://github.com/open-telemetry/opentelemetry-collector-contrib | ||
| repository: "otel/opentelemetry-collector-k8s" | ||
| ports: | ||
| metrics: | ||
| enabled: true | ||
| presets: | ||
| kubernetesAttributes: | ||
| enabled: true | ||
| extractAllPodLabels: true | ||
| # This is the config file for the collector: | ||
| config: | ||
| receivers: | ||
| nop: {} | ||
| otlp: | ||
| protocols: | ||
| grpc: | ||
| endpoint: 0.0.0.0:4317 | ||
| http: | ||
| endpoint: 0.0.0.0:4318 | ||
| extensions: | ||
| # Use the API key from the env for authentication | ||
| bearertokenauth: | ||
| scheme: SUSEObservability | ||
| token: "${env:API_KEY}" | ||
| exporters: | ||
| nop: {} | ||
| otlp/suse-observability: | ||
| auth: | ||
| authenticator: bearertokenauth | ||
| # Put in your own otlp endpoint | ||
| endpoint: <otlp-suse-observability-endpoint> | ||
| compression: snappy | ||
| processors: | ||
| memory_limiter: | ||
| check_interval: 5s | ||
| limit_percentage: 80 | ||
| spike_limit_percentage: 25 | ||
| batch: {} | ||
| resource: | ||
| attributes: | ||
| - key: k8s.cluster.name | ||
| action: upsert | ||
| # Insert your own cluster name | ||
| value: <your-cluster-name> | ||
| - key: service.instance.id | ||
| from_attribute: k8s.pod.uid | ||
| action: insert | ||
| # Use the k8s namespace also as the open telemetry namespace | ||
| - key: service.namespace | ||
| from_attribute: k8s.namespace.name | ||
| action: insert | ||
| connectors: | ||
| # Generate metrics for spans | ||
| spanmetrics: | ||
| metrics_expiration: 5m | ||
| namespace: otel_span | ||
| service: | ||
| extensions: [ health_check, bearertokenauth ] | ||
| pipelines: | ||
| traces: | ||
| receivers: [otlp] | ||
| processors: [memory_limiter, resource, batch] | ||
| exporters: [debug, spanmetrics, otlp/suse-observability] | ||
| metrics: | ||
| receivers: [otlp, spanmetrics, prometheus] | ||
| processors: [memory_limiter, resource, batch] | ||
| exporters: [debug, otlp/suse-observability] | ||
| logs: | ||
| receivers: [nop] | ||
| processors: [] | ||
| exporters: [nop] | ||
| ``` | ||
| {% endcode %} | ||
|
|
||
| {% hint type="warning" %} | ||
| **Use the same cluster name as used for installing the SUSE Observability agent** if you also use the SUSE Observability agent with the Kubernetes stackpack. Using a different cluster name will result in an empty traces perspective for Kubernetes components and will overall make correlating information much harder for SUSE Observability and your users. | ||
| {% endhint %} | ||
|
|
||
| Now install the collector, using the configuration file: | ||
|
|
||
| ```bash | ||
| helm upgrade --install opentelemetry-collector open-telemetry/opentelemetry-collector \ | ||
| --values otel-collector.yaml \ | ||
| --namespace open-telemetry | ||
| ``` | ||
|
|
||
| The collector offers a lot more configuration receivers, processors and exporters, for more details see our [collector page](../collector.md). For production usage often large amounts of spans are generated and you will want to start setting up [sampling](../sampling.md). | ||
|
|
||
| ## Collect telemetry data from your application | ||
|
|
||
| The common way to collect telemetry data is to instrument your application using the Open Telemetry SDK's. We've documented some quick start guides for a few languages, but there are many more: | ||
| * [Java](../instrumentation/java.md) | ||
| * [.NET](../instrumentation/dot-net.md) | ||
| * [Node.js](../instrumentation/node.js.md) | ||
|
|
||
| For other languages follow the documentation on [opentelemetry.io](https://opentelemetry.io/docs/languages/) and make sure to configure the SDK exporter to ship data to the collector you just installed by following [these instructions](../instrumentation/sdk-exporter-config.md). | ||
|
|
||
| ## View the results | ||
| Go to SUSE Observability and make sure the Open Telemetry Stackpack is installed (via the main menu -> Stackpacks). | ||
|
|
||
| After a short while and if your pods are getting some traffic you should be able to find them under their service name in the Open Telemetry -> services and service instances overviews. Traces will appear in the [trace explorer](/use/traces/k8sTs-explore-traces.md) and in the [trace perspective](/use/views/k8s-traces-perspective.md) for the service and service instance components. Span metrics and language specific metrics (if available) will become available in the [metrics perspective](/use/views/k8s-metrics-perspective.md) for the components. | ||
|
|
||
| If you also have the Kubernetes stackpack installed the instrumented pods will also have the traces available in the [trace perspective](/use/views/k8s-traces-perspective.md). | ||
|
|
||
| ## Next steps | ||
| You can add new charts to components, for example the service or service instance, for your application, by following [our guide](/use/metrics/k8s-add-charts.md). It is also possible to create [new monitors](/use/alerting/k8s-monitors.md) using the metrics and setup [notifications](/use/alerting/notifications/configure.md) to get notified when your application is not available or having performance issues. | ||
|
|
||
| # More info | ||
|
|
||
| * [API keys](/use/security/k8s-ingestion-api-keys.md) | ||
| * [Open Telemetry API](../otlp-apis.md) | ||
| * [Customizing Open Telemetry Collector configuration](../collector.md) | ||
| * [Open Telemetry SDKs](../instrumentation/README.md) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.