Skip to content

Commit

Permalink
Add Pulsar HealthCheck support
Browse files Browse the repository at this point in the history
  • Loading branch information
smbecker committed Nov 11, 2024
1 parent 0017092 commit b47e82b
Show file tree
Hide file tree
Showing 19 changed files with 525 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ MYSQL_PORT=3306
MYSQL_PASSWORD=Password12!
ZOOKEEPER_PORT=3000
KAFKA_PORT=9092
PULSAR_PORT=6650
RABBITMQ_PORT=5672
IDSVR_PORT=8888
ORACLE_PORT=1521
Expand All @@ -20,4 +21,4 @@ FTP_PORT=21
FTP_USER=bob
FTP_PASS=12345
RAVENDB_PORT=9030
SOLR_PORT=8983
SOLR_PORT=8983
2 changes: 2 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ flags:
carryforward: true
Publisher.Seq:
carryforward: true
Pulsar:
carryforward: true
RabbitMQ:
carryforward: true
RavenDb:
Expand Down
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ prometheus:
- src/HealthChecks.Prometheus.Metrics/**/*
- src/HealthChecks.Publisher.Prometheus/**/*

pulsar:
- src/HealthChecks.Pulsar/**/*

applicationinsights:
- src/HealthChecks.Publisher.ApplicationInsights/**/*

Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/healthchecks_pulsar_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: HealthChecks Pulsar CD

on:
push:
tags:
- release-pulsar-*
- release-all-*

jobs:
build:
uses: ./.github/workflows/reusable_cd_workflow.yml
secrets: inherit
with:
BUILD_CONFIG: Release
PROJECT_PATH: ./src/HealthChecks.Pulsar/HealthChecks.Pulsar.csproj
PACKAGE_NAME: AspNetCore.HealthChecks.Pulsar
17 changes: 17 additions & 0 deletions .github/workflows/healthchecks_pulsar_cd_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: HealthChecks Pulsar Preview CD

on:
push:
tags:
- preview-pulsar-*
- preview-all-*

jobs:
build:
uses: ./.github/workflows/reusable_cd_preview_workflow.yml
secrets: inherit
with:
BUILD_CONFIG: Release
VERSION_SUFFIX_PREFIX: rc1
PROJECT_PATH: ./src/HealthChecks.Pulsar/HealthChecks.Pulsar.csproj
PACKAGE_NAME: AspNetCore.HealthChecks.Pulsar
75 changes: 75 additions & 0 deletions .github/workflows/healthchecks_pulsar_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: HealthChecks Pulsar CI

on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- src/HealthChecks.Pulsar/**
- test/HealthChecks.Pulsar.Tests/**
- test/_SHARED/**
- .github/workflows/healthchecks_pulsar_ci.yml
- Directory.Build.props
- Directory.Build.targets
tags-ignore:
- release-*
- preview-*

pull_request:
branches: [ master ]
paths:
- src/HealthChecks.Pulsar/**
- test/HealthChecks.Pulsar.Tests/**
- test/_SHARED/**
- .github/workflows/healthchecks_pulsar_ci.yml
- Directory.Build.props
- Directory.Build.targets

jobs:
build:
runs-on: ubuntu-latest
services:
pulsar:
image: apachepulsar/pulsar:latest
env:
PULSAR_MEM: " -Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g"
ports:
- 6650:6650
options: >-
--entrypoint '/bin/bash -c "bin/apply-config-from-env.py conf/standalone.conf && bin/pulsar standalone --no-functions-worker"'
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore
run: |
dotnet restore ./src/HealthChecks.Pulsar/HealthChecks.Pulsar.csproj &&
dotnet restore ./test/HealthChecks.Pulsar.Tests/HealthChecks.Pulsar.Tests.csproj
- name: Check formatting
run: |
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.Pulsar/HealthChecks.Pulsar.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.Pulsar.Tests/HealthChecks.Pulsar.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Build
run: |
dotnet build --no-restore ./src/HealthChecks.Pulsar/HealthChecks.Pulsar.csproj &&
dotnet build --no-restore ./test/HealthChecks.Pulsar.Tests/HealthChecks.Pulsar.Tests.csproj
- name: Test
run: >
dotnet test
./test/HealthChecks.Pulsar.Tests/HealthChecks.Pulsar.Tests.csproj
--no-restore
--no-build
--collect "XPlat Code Coverage"
--results-directory .coverage
--
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
flags: Pulsar
directory: .coverage
16 changes: 15 additions & 1 deletion AspNetCore.Diagnostics.HealthChecks.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Expand Down Expand Up @@ -310,6 +310,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Milvus", "src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Milvus.Tests", "test\HealthChecks.Milvus.Tests\HealthChecks.Milvus.Tests.csproj", "{D49CF52C-9D21-4D98-8A15-A2B259E9C003}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HealthChecks.Pulsar", "src\HealthChecks.Pulsar\HealthChecks.Pulsar.csproj", "{15E844A6-9411-42DF-9862-EBC6A9147D2C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HealthChecks.Pulsar.Tests", "test\HealthChecks.Pulsar.Tests\HealthChecks.Pulsar.Tests.csproj", "{72D9B21B-97A9-4F29-AEBE-A0FC15CC69B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -868,6 +872,14 @@ Global
{D49CF52C-9D21-4D98-8A15-A2B259E9C003}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D49CF52C-9D21-4D98-8A15-A2B259E9C003}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D49CF52C-9D21-4D98-8A15-A2B259E9C003}.Release|Any CPU.Build.0 = Release|Any CPU
{15E844A6-9411-42DF-9862-EBC6A9147D2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15E844A6-9411-42DF-9862-EBC6A9147D2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15E844A6-9411-42DF-9862-EBC6A9147D2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15E844A6-9411-42DF-9862-EBC6A9147D2C}.Release|Any CPU.Build.0 = Release|Any CPU
{72D9B21B-97A9-4F29-AEBE-A0FC15CC69B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72D9B21B-97A9-4F29-AEBE-A0FC15CC69B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72D9B21B-97A9-4F29-AEBE-A0FC15CC69B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72D9B21B-97A9-4F29-AEBE-A0FC15CC69B4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1011,6 +1023,8 @@ Global
{3B812989-2C4E-4FCE-B3A0-EF9C00A9B3A5} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE}
{17913EAF-3B12-495B-80EA-9EB975FBE6BA} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4}
{D49CF52C-9D21-4D98-8A15-A2B259E9C003} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE}
{15E844A6-9411-42DF-9862-EBC6A9147D2C} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4}
{72D9B21B-97A9-4F29-AEBE-A0FC15CC69B4} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2B8C62A1-11B6-469F-874C-A02443256568}
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ HealthChecks packages include health checks for:
| Nats | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | [![view](https://img.shields.io/github/issues/Xabaril/AspNetCore.Diagnostics.HealthChecks/nats)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/nats) | NATS, messaging, message-bus, pubsub |
| Network | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | [![view](https://img.shields.io/github/issues/Xabaril/AspNetCore.Diagnostics.HealthChecks/network)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/network) | Ftp, SFtp, Dns, Tcp port, Smtp, Imap, Ssl |
| Postgres | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | [![view](https://img.shields.io/github/issues/Xabaril/AspNetCore.Diagnostics.HealthChecks/npgsql)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/npgsql)
| Pulsar | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Pulsar)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Pulsar) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Pulsar)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Pulsar) | [![view](https://img.shields.io/github/issues/Xabaril/AspNetCore.Diagnostics.HealthChecks/Pulsar)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/pulsar)
| Identity Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | [![view](https://img.shields.io/github/issues/Xabaril/AspNetCore.Diagnostics.HealthChecks/openidconnect)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/openidconnect)
| Oracle | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | [![view](https://img.shields.io/github/issues/Xabaril/AspNetCore.Diagnostics.HealthChecks/oracle)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/oracle)
| RabbitMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | [![view](https://img.shields.io/github/issues/Xabaril/AspNetCore.Diagnostics.HealthChecks/rabbitmq)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/rabbitmq)
Expand Down Expand Up @@ -161,6 +162,7 @@ Install-Package AspNetCore.HealthChecks.MySql
Install-Package AspNetCore.HealthChecks.Nats
Install-Package AspNetCore.HealthChecks.Network
Install-Package AspNetCore.HealthChecks.Npgsql
Install-Package AspNetCore.HealthChecks.Pulsar
Install-Package AspNetCore.HealthChecks.OpenIdConnectServer
Install-Package AspNetCore.HealthChecks.Oracle
Install-Package AspNetCore.HealthChecks.RabbitMQ
Expand Down Expand Up @@ -699,4 +701,4 @@ answering [questions](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthCh
2. Follow the code guidelines and conventions.
3. New features are not only code, tests and documentation are also mandatory.
4. PRs with [`Ups for grabs`](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/Ups%20for%20grabs)
and [help wanted](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/help%20wanted) tags are good candidates to contribute.
and [help wanted](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/help%20wanted) tags are good candidates to contribute.
1 change: 1 addition & 0 deletions build/versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<HealthCheckPublisherDatadog>8.0.1</HealthCheckPublisherDatadog>
<HealthCheckPublisherPrometheus>8.0.1</HealthCheckPublisherPrometheus>
<HealthCheckPublisherSeq>8.0.1</HealthCheckPublisherSeq>
<HealthCheckPulsar>8.0.1</HealthCheckPulsar>
<HealthCheckRabbitMQ>8.0.2</HealthCheckRabbitMQ>
<HealthCheckRavenDB>8.0.1</HealthCheckRavenDB>
<HealthCheckRedis>8.0.1</HealthCheckRedis>
Expand Down
12 changes: 10 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ services:
- ${KAFKA_PORT}:9092
links:
- zookeeper
pulsar:
image: apachepulsar/pulsar:latest
environment:
PULSAR_MEM: " -Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g"
ports:
- ${PULSAR_PORT}:6650
command: |
/bin/bash -c "bin/apply-config-from-env.py conf/standalone.conf && bin/pulsar standalone --no-functions-worker"
rabbitmq:
image: rabbitmq
ports:
Expand Down Expand Up @@ -165,7 +173,7 @@ services:
image: postgres
ports:
- "8010:5432"
environment:
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=Password12!
nats:
Expand All @@ -180,7 +188,7 @@ services:
ports:
- "8086:8086"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: ci_user
DOCKER_INFLUXDB_INIT_PASSWORD: password
DOCKER_INFLUXDB_INIT_ORG: influxdata
Expand Down
Loading

0 comments on commit b47e82b

Please sign in to comment.