Skip to content
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

chore(docs): Adding App Insights Configuration Page #2820

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Azure App Insights

If you want to use [Azure App Insights](https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview) as the trace data store, you can use the native connection from Tracetest to pull telemetry data.

:::tip
Examples of configuring Tracetest with Azure App Insights can be found in the [`examples` folder of the Tracetest GitHub repo](https://github.com/kubeshop/tracetest/tree/main/examples).
:::

## Direct Connection - Configure Tracetest to Use Azure App Insights as a Trace Data Store

Configure Tracetest to be aware that it has to fetch trace data from Azure App Insights.

Tracetest uses the Golang [Azure SDK](https://learn.microsoft.com/en-us/azure/developer/go/) library to pull to fetch trace data.

### Tracetest Direct Connection to Azure App Insights with the Web UI

In the Web UI, (1) open Settings, and, on the (2) Configure Data Store tab, select (3) Azure App Insights.

![Azure App Insights Direct Connection Settings](../img/appinsights-direct.png)

From the configuration page, add your [App Insights API Access Token](https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-azure-ad-api). Or if you are running Tracetest from a authorized container, you can use the default Active Directory Authentication.

Finally, add the resource ARM ID for the Azure App Insights instance.

### Tracetest Direct Connection to Azure App Insights with the CLI

Or, if you prefer using the CLI, you can use this file config.

```yaml
type: DataStore
spec:
name: AzureAppInsights
type: azureappinsights
default: true
azureappinsights:
connectionType: direct
resourceArmId: <your-arm-id>
accessToken: <your-access-token>
useAzureActiveDirectoryAuth: false
```

Run this command in the terminal and specify the file above.

```bash
tracetest apply datastore -f my/data-store/file/location.yaml
```

<!-- Add back once the examples are ready -->
<!-- :::tip
To learn more, [read the recipe on running a sample app with AWS X-Ray and Tracetest](../../examples-tutorials/recipes/running-tracetest-with-aws-x-ray.md).
::: -->

## OpenTelemetry Collector

You can configure Tracetest to listen for incoming telemetry data from ports `4317` and `4318` for gRPC and REST accordingly, giving you the option to stream the information to both Azure App Insights and Tracetest at the same time.

:::tip
Need help configuring the [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-contrib) so send trace data from your application to Azure App Insights? Read more in [the reference page here](../opentelemetry-collector-configuration-file-reference).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Need help configuring the [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-contrib) so send trace data from your application to Azure App Insights? Read more in [the reference page here](../opentelemetry-collector-configuration-file-reference).
Need help configuring the [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-contrib) to send trace data from your application to Azure App Insights? Read more in [the reference page here](../opentelemetry-collector-configuration-file-reference).

:::

### Tracetest OpenTelemetry Collector connection to Azure App Insights with the Web UI

In the Web UI, (1) open Settings, and, on the (2) Configure Data Store tab, select (3) Azure App Insights, (4) Select Open Telemetry Collector as Connection Type.

![Azure App Insights Otel Connection Settings](../img/appinsights-otel.png)

From the configuration page, copy and customize the OpenTelemetry configuration YAML including the instrumentation key.

### Tracetest OpenTelemetry Collector connection to Azure App Insights with the CLI

Or, if you prefer using the CLI, you can use this file config.

```yaml
type: DataStore
spec:
name: AzureAppInsights
type: azureappinsights
default: true
azureappinsights:
connectionType: collector
useAzureActiveDirectoryAuth: false
```

Run this command in the terminal and specify the file above.

```bash
tracetest apply datastore -f my/data-store/file/location.yaml
```

<!-- Add back once the examples are ready -->
<!-- :::tip
To learn more, [read the recipe on running a sample app with AWS X-Ray and Tracetest](../../examples-tutorials/recipes/running-tracetest-with-aws-x-ray.md).
::: -->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/configuration/img/appinsights-otel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Currently, Tracetest supports the following data stores. Click on the respective
- [Grafana Tempo](./connecting-to-data-stores/tempo)
- [Lightstep](./connecting-to-data-stores/lightstep)
- [New Relic](./connecting-to-data-stores/new-relic)
- [AWS X-Ray](./connecting-to-data-stores/awsxray.md)
- [AWS X-Ray](./connecting-to-data-stores/awsxray.md)3
- [Datadog](./connecting-to-data-stores/datadog)
- [Honeycomb](./connecting-to-data-stores/honeycomb.md)
- [Azure App Insights](./connecting-to-data-stores/azure-app-insights.md)

Continue reading below to learn how to configure the OpenTelemetry Collector to send trace data from your application to any of the trace data stores above.

Expand Down Expand Up @@ -218,3 +219,31 @@ service:
processors: [batch] # make sure to have the probabilistic_sampler before your batch processor
exporters: [otlp/2] # your exporter pointing to your Tempo instance
```

## Configure OpenTelemetry Collector to Send Traces to Azure App Insights

You'll configure the OpenTelemetry Collector to receive traces from your system and then send them to Azure App Insights. And, you don't have to change your existing pipelines to do so.

In your OpenTelemetry Collector config file, make sure to set the `exporter` to `azuremonitor`, with the `endpoint` instrumentation key of your Azure App Insights instance.

```yaml
# collector.config.yaml

# If you already have receivers declared, you can just ignore
# this one and still use yours instead.
receivers:
otlp:
protocols:
grpc:
http:

exporters:
azuremonitor:
instrumentation_key: <your-instrumentation-key>

service:
pipelines:
traces/appinsights:
receivers: [otlp] # your receiver
exporters: [azuremonitor] # your exporter pointing to your Azure App Insights instance
```
1 change: 1 addition & 0 deletions docs/docs/configuration/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Currently, Tracetest supports the following data stores. Click on the respective
- [AWS X-Ray](./connecting-to-data-stores/awsxray)
- [Datadog](./connecting-to-data-stores/datadog)
- [Honeycomb](./connecting-to-data-stores/honeycomb)
- [Azure App Insights](./connecting-to-data-stores/azure-app-insights.md)

## Using Tracetest without a Trace Data Store

Expand Down
7 changes: 6 additions & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ const sidebars = {
id: "configuration/connecting-to-data-stores/honeycomb",
label: "Honeycomb",
},
{
type: "doc",
id: "configuration/connecting-to-data-stores/azure-app-insights",
label: "Azure App Insights",
},
],
},
{
Expand Down Expand Up @@ -381,7 +386,7 @@ const sidebars = {
id: "cli/running-transactions",
label: "Running Transactions",
},
]
],
},
{
type: "doc",
Expand Down
30 changes: 15 additions & 15 deletions web/src/constants/CollectorConfig.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,25 @@ otlp:
http:

processors:
batch:
batch:

exporters:
azuremonitor:
instrumentation_key: <your-instrumentation-key>
otlp/tracetest:
endpoint: tracetest:4317
tls:
insecure: true
azuremonitor:
instrumentation_key: <your-instrumentation-key>
otlp/tracetest:
endpoint: tracetest:4317
tls:
insecure: true

service:
pipelines:
traces/tracetest:
receivers: [otlp]
processors: [batch]
exporters: [otlp/tracetest]
traces/appinsights:
receivers: [otlp]
exporters: [azuremonitor]
pipelines:
traces/tracetest:
receivers: [otlp]
processors: [batch]
exporters: [otlp/tracetest]
traces/appinsights:
receivers: [otlp]
exporters: [azuremonitor]
`;

export const CollectorConfigMap = {
Expand Down