-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
1,319 additions
and
992 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"Major": 4, | ||
"Minor": 1, | ||
"Patch": 1, | ||
"Major": 5, | ||
"Minor": 0, | ||
"Patch": 0, | ||
"PreRelease": "" | ||
} |
This file contains 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 |
---|---|---|
@@ -1,57 +1,13 @@ | ||
# Adapter Host Logging | ||
# Adapter Host Telemetry and Observability | ||
|
||
> Note: this document assumes that you have used the project template for Visual Studio and `dotnet new` to create an adapter host. See [here](../src/DataCore.Adapter.Templates) for more information. | ||
By default, adapter hosts created using the project template for Visual Studio and `dotnet new` use [Serilog](https://serilog.net/) to write log messages to the console. | ||
The adapter host uses OpenTelemetry to observe traces, metrics and logs generated by the application. An OpenTelemetry Protocol (OTLP) exporter that exports traces is enabled by default. You can disable the exporter, modify the signals to be exported, or configure the OTLP collector endpoint using the `appsettings.json` file. | ||
|
||
The section below describes how to use Serilog to write logs to files in addition to the console. Please refer to the Serilog documentation for full details of how to write logs to additional destinations. | ||
See [here](https://github.com/wazzamatazz/opentelemetry-extensions) for more information about configuring the OTLP exporter. | ||
|
||
Additionally, metrics can be scraped from the application's `/metrics` endpoint in Prometheus format. The Prometheus endpoint can be disabled or removed from the `Program.cs` file if not required. | ||
|
||
# Configuring Serilog to write to files via `appsettings.json` | ||
The adapter host uses the Microsoft.Extensions.Logging library for logging. If required, you can add additional logging providers to the application by modifying the `Program.cs` file. | ||
|
||
Serilog can be configured to write to log files with a simple configuration file modification: | ||
|
||
```json | ||
{ | ||
"Serilog": { | ||
"MinimumLevel": { | ||
"Default": "Information", | ||
"Override": { | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
} | ||
}, | ||
"WriteTo": [ | ||
{ | ||
"Name": "File", | ||
"Args": { | ||
"path": "./logs/log-.txt", | ||
"rollingInterval": "Day", | ||
"formatter": { | ||
"type": "Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact" | ||
} | ||
} | ||
}, | ||
{ | ||
"Name": "Console", | ||
"Args": { | ||
"formatter": { | ||
"type": "Serilog.Templates.ExpressionTemplate, Serilog.Expressions", | ||
"template": "{@l:w4}: {SourceContext}[{Coalesce(EventId.Id, '0')}] \n {@m}\n{@x}", | ||
"theme": "Serilog.Templates.Themes.TemplateTheme::Code, Serilog.Expressions" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
The above example performs the following actions: | ||
|
||
- Writes log messages to the console using the same default format used by Microsoft's console logger. | ||
- Writes log messages to daily log files in the `logs/` folder under the adapter host's installation directory using the [Compact Log Event Format](https://clef-json.org/) (CLEF). | ||
|
||
By default, log files for the last 31 days are kept. | ||
|
||
Refer to the Serilog documentation for full details about configuration of logging destinations! |
This file contains 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,45 @@ | ||
# Release Notes - v5.0.0 | ||
|
||
Welcome to version 5.0.0 of the adapter toolkit for App Store Connect! | ||
|
||
|
||
# Breaking Changes | ||
|
||
This release contains the following breaking changes: | ||
|
||
|
||
## Changes to Entity Builder Types | ||
|
||
Types such as `TagValueBuilder` that are used to construct adapter entities using a fluent interface have been refactored to derive from a common base type, `AdapterEntityBuilder<T>`. The base type defines some common behaviour such as management of custom `AdapterProperty` properties added to the builder. | ||
|
||
Duplicate properties can no longer be defined on any builder derived from `AdapterEntityBuilder<T>`. Instead, callers can choose whether existing properties with the same name should be retained or dropped when adding properties to the builder. | ||
|
||
Note that `AdapterEntityBuilder<T>` does not define any public methods for adding properties to the builder; these are instead provided by extension methods defined on the `AdapterEntityBuilderExtensions` class. | ||
|
||
|
||
## Hash Code Computation in `TagIdentifierComparer` | ||
|
||
The hash code computation in `TagIdentifierComparer` has been modified to remove unnecessary allocations. A side effect of this change is that the hash code computed for a given `TagIdentifier` is now different. | ||
|
||
|
||
# Non-Breaking Changes | ||
|
||
This release includes the following changes and features: | ||
|
||
|
||
## String Caching | ||
|
||
The new `StringCache` class is now used to cache frequently-used string instances instead of using `string.Intern` directly. `StringCache` uses a `ConcurrentDictionary<string, string>` to cache string instances; benchmarks show that this usually gives superior performance compared to `string.Intern`. `StringCache` can be configured to use `string.Intern` instead of its own cache by setting the `DataCore.Adapter.StringCache.UseNativeIntern` flag on `AppContext` to `false`. | ||
|
||
Additionally, new `string` extension methods have been added in the `System` namespace to allow strings to be interned easily using `StringCache`: | ||
|
||
* `InternToStringCache` will intern the string if it has not already been interned and returns the interned reference to the string e.g. `var str = "my string".InternToStringCache();` | ||
* `GetFromStringCache` returns the interned reference to the string or `null` if the string has not been interned e.g. `var str = "my other string".GetFromStringCache();` | ||
|
||
|
||
## Template Changes | ||
|
||
The `dotnet new` template has been modified: | ||
|
||
* The template no longer uses Serilog for logging and instead reverts to the standard Microsoft.Extensions.Logging library. Developers are free to add additional logging providers to the application as required. | ||
* An OpenTelemetry Protocol (OTLP) exporter is now enabled by default for exporting traces. The exporter endpoint and the signals to be exported (i.e. traces, logs, metrics) can be configured using the `appsettings.json` file. |
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
{ | ||
"Serilog": { | ||
"MinimumLevel": { | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Override": { | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
} | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
} | ||
} | ||
} |
Oops, something went wrong.