Skip to content

Commit

Permalink
docs: small changes to v3.0.0 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BEagle1984 committed Mar 21, 2021
1 parent af9180d commit 0b7bd53
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 10 deletions.
19 changes: 19 additions & 0 deletions docs/concepts/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,22 @@ Id | Level | Message | Reference
4022 | Debug | Error occurred retrying to connect to the MQTT broker. | clientId: {clientId} | [ConnectRetryError](xref:Silverback.Diagnostics.MqttLogEvents#Silverback_Diagnostics_MqttLogEvents_ConnectRetryError)
4023 | Warning | Connection with the MQTT broker lost. The client will try to reconnect. | clientId: {clientId} | [ConnectionLost](xref:Silverback.Diagnostics.MqttLogEvents#Silverback_Diagnostics_MqttLogEvents_ConnectionLost)
4031 | Debug | Producer queue processing was canceled. | [ProducerQueueProcessingCanceled](xref:Silverback.Diagnostics.MqttLogEvents#Silverback_Diagnostics_MqttLogEvents_ProducerQueueProcessingCanceled)

## Tracing

An [Activity](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activity) is created:
* in the Consumer when a message is received (initialized with the `traceparent` header, if submitted)
* in the Producer when a message is being sent (submitting the `Activity.Id` in the `traceparent` header )
* when a sequence (e.g. a [BatchSequence](xref:Silverback.Messaging.Sequences.Batch.BatchSequence)) is being consumed
* when a subscriber is being invoked (either internally or from a consumer)

This allows to trace the methods execution and follow a message across different services (distributed tracing).

The following table summarizes the activities and the information being tracked.

Id | Description / Tags
:-- | :--
`Silverback.Integration.Produce` | A message is being produced to a message broker.<br/><br/>Tags:<ul><li>`messaging.message_id`</li><li>`messaging.destination`</li><li>[`messaging.kafka.message_key`]</li><li>[`messaging.kafka.partition`]</li></ul>
`Silverback.Integration.Consume` | A consumed message is being processed.<br/><br/>Tags: <ul><li>`messaging.message_id`</li><li>`messaging.destination`</li><li>[`messaging.sequence.activity`]</li><li>[`messaging.kafka.message_key`]</li><li>[`messaging.kafka.partition`]</li></ul>
`Silverback.Integration.Sequence` | A sequence of messages is being processed.<br/><br/>Tags: _none_
`Silverback.Core.Subscribers.InvokeSubscriber` | A subscriber is being invoked to process a message.<br/><br/>Tags:<ul><li>`SubscriberType`</li><li>`SubscriberMethod`</li></ul>
4 changes: 4 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ The full source code is available on [GitHub](https://github.com/BEagle1984/silv

The [Directory.Build.props](https://github.com/BEagle1984/silverback/blob/master/Directory.Build.props) file in the root of the repository contains the current version of the NuGet packages being built and referenced. The `<BaseVersion>` and `<VersionSuffix>` tags can be used to increment the current version.

### Commits

Please try to follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for the commit messages.

### Building (NuGet packages)

The nuget packages can be built locally using the powershell script under `/nuget/Update.ps1`. Add the `-l` switch to clear the local nuget cache as well (especially useful when building the same version over and over).
Expand Down
3 changes: 3 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ uid: releases
* Improve outbound routing customization options with endpoint name resolvers (see <xref:outbound-routing>)
* Add non-blocking `Produce`/`ProduceAsync`/`RawProduce`/`RawProduceAsync` overloads to <xref:Silverback.Messaging.Broker.IProducer>, better suitable for higher throughput scenarios (see <xref:producer>)
* Refactor broker event handlers (see <xref:broker-callbacks>)
* Expose [IConsumer.StopAsync](xref:Silverback.Messaging.Broker.IConsumer#Silverback_Messaging_Broker_IConsumer_StopAsync) and [IConsumer.StartAsync](xref:Silverback.Messaging.Broker.IConsumer#Silverback_Messaging_Broker_IConsumer_StartAsync) methods to pause and resume consumers
* Add log levels configuration (see <xref:logging>)
* Improve (distributed) tracing (see <xref:logging>)
* Allow header names customization (see <xref:headers>)
* Add consumer status information and statistics (see <xref:message-broker#consumer-management-api>)
* Add basic consumers health check (see <xref:message-broker#health-monitoring>)
Expand Down Expand Up @@ -102,6 +104,7 @@ uid: releases
* <xref:Silverback.Messaging.Sequences.Chunking.ChunkSettings> moved from `Silverback.Messaging.LargeMessages` namespace to `Silverback.Messaging.Sequences.Chunking`
* Replaced _CoreEventIds_, _IntegrationEventIds_, _KafkaEventIds_ and _RabbitEventIds_ with <xref:Silverback.Diagnostics.CoreLogEvents>, <xref:Silverback.Diagnostics.IntegrationLogEvents>, <xref:Silverback.Diagnostics.KafkaLogEvents> and <xref:Silverback.Diagnostics.RabbitLogEvents> (see also <xref:logging>)
* Deprecated support for Entity Framework 2, only the version 3.0.1 of [Silverback.Core.EntityFrameworkCore](https://www.nuget.org/packages/Silverback.Core.EntityFrameworkCore) will work with Silverback 3.0.0
* Modified message encryption for chunked messages and it will not be compatible with previous versions of Silverback (affects chunking+encryption only)

## [2.2.0](https://github.com/BEagle1984/silverback/releases/tag/v2.2.0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ public async Task HandleAsync(ProducerPipelineContext context, ProducerBehaviorH
Check.NotNull(context, nameof(context));
Check.NotNull(next, nameof(next));

using (var activity = ActivitySources.StartProduceActivity(context.Envelope))
{
_activityEnricherFactory.GetActivityEnricher(context.Envelope.Endpoint)
.EnrichOutboundActivity(activity, context);
await next(context).ConfigureAwait(false);
}
using var activity = ActivitySources.StartProduceActivity(context.Envelope);
_activityEnricherFactory
.GetActivityEnricher(context.Envelope.Endpoint)
.EnrichOutboundActivity(activity, context);
await next(context).ConfigureAwait(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ public static Activity StartConsumeActivity(IRawInboundEnvelope envelope)
public static Activity? StartSequenceActivity()
{
Activity? messageActivity = Activity.Current;
Activity? sequenceAcivity = ConsumeActivitySource.StartActivity(
Activity? sequenceActivity = ConsumeActivitySource.StartActivity(
SequenceActivityName,
ActivityKind.Internal,
new ActivityContext(
ActivityTraceId.CreateRandom(),
ActivitySpanId.CreateRandom(),
ActivityTraceFlags.None));

if (messageActivity != null && sequenceAcivity?.Id != null)
if (messageActivity != null && sequenceActivity?.Id != null)
{
messageActivity.SetTag(ActivityTagNames.SequenceActivity, sequenceAcivity.Id);
messageActivity.SetTag(ActivityTagNames.SequenceActivity, sequenceActivity.Id);
}

return sequenceAcivity;
return sequenceActivity;
}

private static Activity ForceStartActivity(
Expand Down

0 comments on commit 0b7bd53

Please sign in to comment.