Skip to content

Commit 4914cbf

Browse files
committed
Minor tidy up to focus on tracing rather than metrics
1 parent f54b8b6 commit 4914cbf

File tree

5 files changed

+7
-34
lines changed

5 files changed

+7
-34
lines changed

temporal-examples/prometheus.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ scrape_configs:
1919
- host.docker.internal:9000
2020
labels:
2121
group: "worker-metrics"
22+
23+
- job_name: "microserviceworkermetrics"
24+
static_configs:
25+
- targets:
26+
- host.docker.internal:9001
27+
labels:
28+
group: "worker-metrics"

temporal-examples/temporal-worker/AutoFac/Modules/TemporalWorkerConfigurationModule.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ protected override void Load(ContainerBuilder builder)
3939

4040
var assemblyName = typeof(TemporalClient).Assembly.GetName();
4141

42-
using var meter = new Meter(assemblyName.Name!, assemblyName.Version!.ToString());
43-
4442
services
4543
.AddTemporalClient(clientHost, clientNamespace)
4644
.Configure(options =>
@@ -58,19 +56,6 @@ protected override void Load(ContainerBuilder builder)
5856
}
5957
);
6058

61-
options.Runtime = new TemporalRuntime(
62-
new TemporalRuntimeOptions()
63-
{
64-
Telemetry = new TelemetryOptions()
65-
{
66-
Metrics = new MetricsOptions()
67-
{
68-
CustomMetricMeter = new CustomMetricMeter(meter),
69-
},
70-
},
71-
}
72-
);
73-
7459
options.Interceptors = new[] { new TracingInterceptor() };
7560
});
7661

temporal-examples/temporal-worker/Program.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ private static async Task Main(string[] args)
4848
.AddOtlpExporter(o => o.Endpoint = new Uri("http://host.docker.internal:4317"))
4949
.Build();
5050

51-
using var meterProvider = Sdk.CreateMeterProviderBuilder()
52-
.SetResourceBuilder(resourceBuilder)
53-
.AddMeter(assemblyName.Name!)
54-
.AddOtlpExporter(o => o.Endpoint = new Uri("http://host.docker.internal:4317"))
55-
.Build();
56-
5751
await host.RunAsync();
5852
}
5953
}

temporal-examples/workflows/ExampleActivities.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ public async Task<string> GenericTask()
1818
ActivityExecutionContext.Current.Logger.LogInformation(
1919
"Executing activity for OpenTelemetry sample."
2020
);
21-
ActivityExecutionContext
22-
.Current.MetricMeter.CreateCounter<int>(
23-
"my-activity-counter",
24-
description: "Counter used to instrument an activity."
25-
)
26-
.Add(123);
2721
var duration = 2000;
2822
_logger.LogInformation("Starting delay: {Duration}", duration);
2923
await Task.Delay(duration);

temporal-examples/workflows/ExampleWithChildren.workflow.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ public async Task<string> RunAsync()
1818
MaximumAttempts = 3,
1919
};
2020

21-
Workflow
22-
.MetricMeter.CreateCounter<int>(
23-
"my-workflow-counter",
24-
description: "Replay-safe counter for instrumentation inside a workflow."
25-
)
26-
.Add(123);
27-
2821
List<string> childNames = await Workflow.ExecuteActivityAsync(
2922
(ExampleActivities a) => a.GenerateChildWorkflowsName(),
3023
new ActivityOptions

0 commit comments

Comments
 (0)