Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions src/Cli.Tests/ConfigGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ public void TestSpecialCharactersInConnectionString()
""provider"": ""AppService""
},
""mode"": ""production""
},
""telemetry"": {
""open-telemetry"": {
""enabled"": true,
""endpoint"": ""@env('OTEL_EXPORTER_OTLP_ENDPOINT')"",
""headers"": ""@env('OTEL_EXPORTER_OTLP_HEADERS')"",
""service-name"": ""@env('OTEL_SERVICE_NAME')""
}
}
},
""autoentities"": {},
Expand Down
7 changes: 4 additions & 3 deletions src/Cli.Tests/EndToEndTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Azure.DataApiBuilder.Config.Converters;
using Azure.DataApiBuilder.Product;
using Cli.Constants;
using Microsoft.Data.SqlClient;
Expand Down Expand Up @@ -116,7 +117,7 @@ public void TestInitializingRestAndGraphQLGlobalSettings()
string[] args = { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql", "--rest.path", "/rest-api", "--rest.enabled", "false", "--graphql.path", "/graphql-api" };
Program.Execute(args, _cliLogger!, _fileSystem!, _runtimeConfigLoader!);

DeserializationVariableReplacementSettings replacementSettings = new(azureKeyVaultOptions: null, doReplaceEnvVar: true, doReplaceAkvVar: true);
DeserializationVariableReplacementSettings replacementSettings = new(azureKeyVaultOptions: null, doReplaceEnvVar: true, doReplaceAkvVar: true, envFailureMode: EnvironmentVariableReplacementFailureMode.Ignore);
Assert.IsTrue(_runtimeConfigLoader!.TryLoadConfig(
TEST_RUNTIME_CONFIG_FILE,
out RuntimeConfig? runtimeConfig,
Expand Down Expand Up @@ -196,7 +197,7 @@ public void TestEnablingMultipleCreateOperation(CliBool isMultipleCreateEnabled,

Program.Execute(args.ToArray(), _cliLogger!, _fileSystem!, _runtimeConfigLoader!);

DeserializationVariableReplacementSettings replacementSettings = new(azureKeyVaultOptions: null, doReplaceEnvVar: true, doReplaceAkvVar: true);
DeserializationVariableReplacementSettings replacementSettings = new(azureKeyVaultOptions: null, doReplaceEnvVar: true, doReplaceAkvVar: true, envFailureMode: EnvironmentVariableReplacementFailureMode.Ignore);
Assert.IsTrue(_runtimeConfigLoader!.TryLoadConfig(
TEST_RUNTIME_CONFIG_FILE,
out RuntimeConfig? runtimeConfig,
Expand Down Expand Up @@ -273,7 +274,7 @@ public void TestAddTelemetry(string? appInsightsEnabled, string appInsightsConnS
// Perform assertions on various properties.
Assert.IsNotNull(runtimeConfig);
Assert.IsNotNull(runtimeConfig.Runtime);
Assert.IsNull(runtimeConfig.Runtime.Telemetry);
Assert.IsNotNull(runtimeConfig.Runtime.Telemetry);

string[] addTelemetryArgs;
if (appInsightsEnabled is null)
Expand Down
3 changes: 1 addition & 2 deletions src/Cli.Tests/EnvironmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ public async Task FailureToStartEngineWhenEnvVarNamedWrong()
string? output = await process.StandardError.ReadLineAsync();
Assert.AreEqual("Deserialization of the configuration file failed during a post-processing step.", output);
output = await process.StandardError.ReadToEndAsync();
StringAssert.Contains(output, "Environmental Variable, "
+ expectedEnvVarName + ", not found.", StringComparison.Ordinal);
StringAssert.Contains(output, "A valid Connection String should be provided.", StringComparison.Ordinal);
process.Kill();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Provider: AppService
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@
Provider: AppService
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
Provider: AppService
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
}
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Provider: Simulator
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Provider: StaticWebApps
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Provider: AppService
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
}
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Provider: AppService
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Provider: AppService
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
Provider: AppService
},
Mode: Production
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
Authentication: {
Provider: AppService
}
},
Telemetry: {
OpenTelemetry: {
Enabled: true,
Endpoint: @env('OTEL_EXPORTER_OTLP_ENDPOINT'),
Headers: @env('OTEL_EXPORTER_OTLP_HEADERS'),
ServiceName: @env('OTEL_SERVICE_NAME')
}
}
},
Entities: []
Expand Down
Loading