Browse Source
This starts the zipkin container, but `--dtrace zipkin=...` is still needed for now.davidfowl/ingress-changes
2 changed files with 47 additions and 0 deletions
@ -0,0 +1,45 @@ |
|||||
|
// Licensed to the .NET Foundation under one or more agreements.
|
||||
|
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
// See the LICENSE file in the project root for more information.
|
||||
|
|
||||
|
using System; |
||||
|
using System.Globalization; |
||||
|
using System.IO; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Microsoft.Tye.Extensions.Zipkin |
||||
|
{ |
||||
|
internal sealed class ZipkinExtension : Extension |
||||
|
{ |
||||
|
public override string Name => "zipkin"; |
||||
|
|
||||
|
public override Task ProcessAsync(ExtensionContext context, ExtensionConfiguration config) |
||||
|
{ |
||||
|
if (context.Application.Services.Any(s => s.Name == "zipkin")) |
||||
|
{ |
||||
|
context.Output.WriteDebugLine("Zipkin service already configured. Skipping..."); |
||||
|
return Task.CompletedTask; |
||||
|
} |
||||
|
|
||||
|
if (context.Operation == ExtensionContext.OperationKind.LocalRun) |
||||
|
{ |
||||
|
var service = new ContainerServiceBuilder("zipkin", "openzipkin/zipkin") |
||||
|
{ |
||||
|
Bindings = |
||||
|
{ |
||||
|
new BindingBuilder() |
||||
|
{ |
||||
|
Port = 9411, |
||||
|
ContainerPort = 9411, |
||||
|
Protocol = "http", |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
context.Application.Services.Add(service); |
||||
|
} |
||||
|
|
||||
|
return Task.CompletedTask; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue