Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</ItemGroup>
<ItemGroup Label="Community Packages">
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Flagd" Version="13.4.0" />
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector" Version="13.4.0" />
<PackageVersion Include="Scalar.Aspire" Version="0.11.2" />
</ItemGroup>
<ItemGroup Label="Microsoft Packages">
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,27 @@ aspire run
- Web Frontend: [https://localhost:7070](https://localhost:7070)
- API Service: [https://localhost:7071](https://localhost:7071)
- Aspire Dashboard: [https://localhost:15888](https://localhost:15888)
- Grafana (LGTM): [http://localhost:3000](http://localhost:3000) (`admin` / `admin`)
Comment thread
askpt marked this conversation as resolved.
Outdated

### Provisioned Grafana Dashboards

Grafana dashboard provisioning is configured in the AppHost and mounted into the LGTM container.

- Provider config: `src/Garage.AppHost/grafana/provisioning/dashboards/custom.yaml`
- Dashboard JSON folder: `src/Garage.AppHost/grafana/provisioning/dashboards/custom/`

To add an external dashboard:

1. Export or download the dashboard JSON.
2. Place it in `src/Garage.AppHost/grafana/provisioning/dashboards/custom/`.
3. Restart Aspire (`aspire run`) so LGTM reloads provisioned dashboards.
4. Open Grafana and navigate to the **OpenFeature** folder.

The starter dashboard includes datasource placeholder variables you can reuse in your panels:

- `$metrics_ds` (Prometheus)
- `$logs_ds` (Loki)
- `$traces_ds` (Tempo)

### 6. OpenAPI and Scalar Documentation (Development)

Expand Down
1 change: 1 addition & 0 deletions src/Garage.AppHost/Garage.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageReference Include="Aspire.Hosting.JavaScript" />
<PackageReference Include="Aspire.Hosting.Python" />
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Flagd" />
<PackageReference Include="CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector" />
<PackageReference Include="Scalar.Aspire" />
</ItemGroup>

Expand Down
15 changes: 14 additions & 1 deletion src/Garage.AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@

var builder = DistributedApplication.CreateBuilder(args);

var grafanaProvisioningPath = Path.Combine(builder.AppHostDirectory, "grafana", "provisioning", "dashboards");

// Add Grafana LGTM stack (Loki, Tempo, Prometheus, Pyroscope, Grafana)
var lgtm = builder.AddContainer("lgtm", "grafana/otel-lgtm", "latest")
.WithHttpEndpoint(port: 3000, targetPort: 3000, name: "grafana")
.WithBindMount(grafanaProvisioningPath, "/otel-lgtm/grafana/conf/provisioning/dashboards", isReadOnly: true)
Comment thread
askpt marked this conversation as resolved.
Outdated
.WithExternalHttpEndpoints();

// Add collector for OpenTelemetry signals
var collector = builder.AddOpenTelemetryCollector("opentelemetry-collector")
.WithConfig("otel/config.yaml")
.WithAppForwarding()
.WaitFor(lgtm);
Comment thread
askpt marked this conversation as resolved.
Outdated

// Add Azure Container App Environment for publishing
var containerAppEnvironment = builder
.AddAzureContainerAppEnvironment("cae");
Expand Down Expand Up @@ -59,7 +73,6 @@
var flagsApi = builder.AddGoApp("flagsapi", "../Garage.FeatureFlags/")
.WithHttpEndpoint(env: "PORT")
.WithExternalHttpEndpoints()
.WithEnvironment("OTEL_EXPORTER_OTLP_PROTOCOL", "http/protobuf")
.PublishAsDockerFile();

if (!builder.ExecutionContext.IsPublishMode)
Expand Down
12 changes: 12 additions & 0 deletions src/Garage.AppHost/grafana/provisioning/dashboards/custom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: 1

providers:
- name: "OpenFeature Dashboards"
orgId: 1
folder: "OpenFeature"
type: file
disableDeletion: false
allowUiUpdates: true
options:
path: /otel-lgtm/grafana/conf/provisioning/dashboards/custom
foldersFromFilesStructure: false
Loading
Loading