-
Notifications
You must be signed in to change notification settings - Fork 64
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
Release new version of ECS.NET 8.6.0 #197
Comments
@Mpdreamz @gregkalapos Any news when we can use it? We're waiting for many months already |
Same for me. Eager to use updated version to get rid of some workarounds |
Is this package still being maintained? We desperately need #167 but it seems that there hasn't been a release in 1,5 years. Is there something we can do to help push this out? |
Still maintained folks! Thanks for the nudges for an update. I have been on leave for an extended period of time but am back working on getting an update out the door. Any feedback on the upcoming pre-release would be most welcomed! Will comment on this issue when it goes up on nuget. |
Heads up here that we just shipped version I intend to wait two weeks to collect feedback on this new version before shipping it as a GA release ( A LOT of changes have gone in since we last release Here are some highlights: New integrations
Big Updates:
Breaking Changes.
|
Can you please include .netstandard2.0 in the official 8.4.0 release. We need to consume this in fullframework, the alpha1 release only contains .netstandard2.1 assemblies @Mpdreamz |
@Mpdreamz Are there plans to update documentation to show how to put all these together? For example, how to enhance the EcsDocument with custom fields. I noticed that you're putting forward an alternative to |
@reydelleon-skuvault absolutely, docs are a big prerequisite for the 8.4.0 release. I tried to capture some of the main differences between the sinks here for now: https://github.com/elastic/ecs-dotnet/tree/main/src/Elastic.CommonSchema.Serilog.Sink#comparison-with-serilogsinkselasticsearch Any feedback or additional questions you may have are more than welcomed! |
A quick extremely raw example of custom EcsDocument implementation is here: https://github.com/elastic/ecs-dotnet/blob/main/src/Elastic.CommonSchema.BenchmarkDotNetExporter/Domain/BenchmarkDocument.cs#L16 |
How can i set a custom index, it always defaults to ecs-dotnet-logs |
Using what integration? |
Using aspnet core similar to the example you added earlier examples/aspnetcore-with-extensions-logging |
If you are using {
"Logging": {
"Elasticsearch": {
"ShipTo": {
"NodePoolType": "Static",
"NodeUris": [ "http://localhost:9200" ]
},
"DataStream": {
"DataSet": "my.application"
}
},
"LogLevel" : {
"Default": "Trace",
"Microsoft": "Warning"
}
}
}
This will log to You can also configure this in the application builder. builder.Host.ConfigureLogging((_, loggingBuilder) =>
{
loggingBuilder.AddElasticsearch(opts =>
{
opts.DataStream = new DataStreamNameOptions
{
Type = "logs", DataSet = "dotnet", Namespace = "default"
}
}), |
I've just pushed |
It doesn't contain a .netstandard2.0 under libs, can you take a look please ? |
@Mpdreamz I'm trying to use the new sink but I'm not seeing a way to specify auth credentials when configuring it. There is nothing about this in the README and looking through the code I wasn't able to identify a way to do this. Can you provide some guidance on this and perhaps add something in the examples in the README? |
@Mpdreamz I too can't seem to find a way of setting auth on new Serilog Elastic sink. I think this would be achievable by exposing setter for ElasticsearchSinkOptions.Transport or some other, maybe nicer way. Currently it's always DefaultHttpTransport with default TransportConfiguration. |
@reydelleon-skuvault @lewinskimaciej see #267 (comment) for example on setting up the auth options |
@Mpdreamz how can we configure for .netfullframework where ILogger is not an option? |
@HubDevUser you can use ILogger in net framework using the nuget: <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" /> |
@HubDevUser The example you linked is for the logging provider, not the sink. @Mpdreamz We need an example that works for the sink. Do we have one? |
Found the way to do it, but it is rather convoluted if all I want to change is the authentication.
@Mpdreamz Is there a better way to do this? |
@reydelleon-skuvault thanks for bringing this to my attention I've opened #286 to address this usability issue. With that you should be able to use:
|
I just pushed Thanks everyone for kicking the tires! |
I just pushed ECS.NET 8.4.0-alpha4 that includes everyones feedback and PR's much obliged to everyone kicking the tires! I opened #291 to bump us to 8.6.0 and this includes some non breaking changes to how we bootstrap index templates. This PR will allow new version to upgrade template indices. |
@Mpdreamz Is there a good way to see logs about the sink activity? I have SelfLog enabled for Serilog and the sink configured but thought I'm not getting any data in Elasticsearch, there is no indication as to what is the cause for this. Nothing written to the self log file (is it supposed to?). I have disabled pinging (a shot in the dark) but that didn't resolve it. I do have logs in the Console and local file, so there is content. It is just not making it to Elasticsearch. |
We are logging all export errors to Serilog's Self log:
The following diagnostics method is still ugly and not intended to make it to
What does |
@Mpdreamz This is what I get from the code you posted:
That's it. No more details than that. Here is my setup (without the diagnostic code), in case I'm doing something wrong here:
|
I ended up (successfully) shipping the logs to a different Elasticsearch server, which means two things: 1. the problem was the server I was trying to ship to and 2. The sink works as expected. That said, I still don't know what the problem with the original server was because I didn't get anything in the Self log. |
@reydelleon-skuvault Thanks for reporting back another instance works! I would still love to improve the experience here and understand why the other instance does not work. Can you run the following in a new console application? Of course using ChannelListener<EnhancedEcsDocument, BulkResponse>? listener = null;
var waitHandle = new CountdownEvent(1);
// -- Setup Serilog --
var nodes = new[] { new Uri("http://localhost:9200") };
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Elasticsearch<EnhancedEcsDocument>(nodes, opts =>
{
opts.BootstrapMethod = BootstrapMethod.None;
opts.DataStream = new DataStreamName("logs", "console-example");
opts.ConfigureChannel = channelOpts => {
channelOpts.BufferOptions = new BufferOptions
{
ExportMaxConcurrency = 1,
OutboundBufferMaxSize = 2,
WaitHandle = waitHandle
};
listener = new ChannelListener<EnhancedEcsDocument, BulkResponse>().Register(channelOpts);
};
},
transportConfig =>
transportConfig
.Authentication(new BasicAuthentication( "someUSer", "somePassword"))
.DisablePing()
)
.CreateLogger();
// -- Log 2 items and wait for flush --
Log.Logger.Information("Writing event 1");
Log.Logger.Information("Writing event 2");
if (!waitHandle.WaitHandle.WaitOne(TimeSpan.FromSeconds(10)))
throw new Exception($"No flush occurred in 10 seconds: {listener}", listener?.ObservedException);
else
{
Console.WriteLine("Successfully indexed data to Elasticsearch");
Console.WriteLine(listener);
} Thanks in advance! |
@Mpdreamz This is what I get:
Once more, I think the issue has to do with my server setup in this case. There seems to be more info here than in my previous attempt. Note that although there are no publishing failures reported in the metrics, the logs in this case never made it to Elasticsearch. For comparison, here is the output using a different server, where the credentials are wrong.
[UPDATE]
This seems to explain the exception outputted by the listener. There is still the fact that I'm not seeing any of this in the self-log, but that might also be an issue with my own setup. |
@Mpdreamz Is there documentation around SSL certificate configuration. What would be the best course of action if we're using a test Elasticsearch server (in Docker container, for example) that has a self signed certificate? Can I disable certificate validation on the sink for testing? |
@Mpdreamz I got another question about customizing the The examples I have found peppered in READMEs and tests all show contrived examples of how to subclass Here is the
The problem that I see with this is that I don't necessarily set the whole object in a I'm confused as to how all this should work (adding custom properties to Perhaps what I'm missing is how things should look like in the Serilog Any guidance on this would be appreciated, since I need to add properties (not in metadata/labels). |
.WriteTo.Elasticsearch(nodes, opts =>
{
//
}, transport =>
{
transport.ServerCertificateValidationCallback(CertificateValidations.AllowAll);
}) |
Just a heads up that today we (finally) released a GA version of the ECS .NET libraries New documentation: https://www.elastic.co/guide/en/ecs-logging/dotnet/current/intro.html You should be able to upgrade to Thanks a ton for everyone involved, all the contributions, feedback and questions truly helped make this a mammoth of a release. It took a considerable time and effort to move us from 1.6.0-alpha1 to 8.6.0 with the main issue being specification format changes requiring us to retool our code generation from the ground up.
Formatters:
Datashippers:
Enrichers: While all ECS logging libraries are New architecture: We laid out a completely new architecture for our datashippers in this repository now taking advantage of https://github.com/elastic/elastic-ingest-dotnet Is a dedicated ECS event data shipper that can bootstrap target datastreams/indices with the appropriate ECS component templates and settings. |
8.4.0-alpha
first to validate our build tooling. (@Mpdreamz)labels
for value types andmetadata
for objects. (@Mpdreamz) Set ECS fields from message templates #229metadata
[BUG] MetaDataDictionaryConverter - NullReferenceException #219 (@Mpdreamz)The text was updated successfully, but these errors were encountered: