Pings service
The Pings service is the service that collects ping requests from all Sourcegraph instances, and is available at pings.sourcegraph.com
.
- As of 5.2.0, ping requests are sent to
https://pings.sourcegraph.com/updates
directly. - For Sourcegraph instances that prior to 5.2.0, all ping requests sent to
https://sourcegraph.com/.api/updates
are being transparently forwarded tohttps://pings.sourcegraph.com/updates
.
NOTE: There is now a generated operations reference for the MSP-based Pings service in Pings infrastructure, generated by
sg msp operations
- as the generated docs improve, some content from this page will be migrated away.
Service images
Source code for Pings service is in sourcegraph/sourcegraph/cmd/pings. The image gets built the same way as any other Sourcegraph service, i.e. with insiders
, the standard main
-branch and main-dry-run
tags.
All images tags are available in the Docker Hub.
Local development
For local development, please refer to its README.
Operations
Infrastructure access
Refer to Pings infrastructure (go/msp-ops/pings) for Entitle requests that are needed to get access to Pings service infrastructure:
Deployment
The Pings service infrastructure is defined in sourcegraph/managed-services/services/pings
utilizing Managed Services Platform.
Modify deployment manifest
To modify the deployment manifest:
- Update
service.yaml
file - In the repository root, run
sg msp generate services/pings/service.yaml prod
- Stage changes and make a pull request
- The Terraform Cloud rolls out changes
Use a different image tag
To specify a Docker image tag other than the default, update the service.yaml
:
- id: prod
...
deploy:
type: manual
+ manual:
+ tag: 218287_2023-05-10_5.0-5bd03cd18e71
Re-deploy the same manifest
Go to the “Deploy revision” page of the Cloud Run service and click DEPLOY (bottom of the page) without changing any configuration. This will also happen whenever a Terraform change happens to the “cloudrun” stack.
Update the service resource allocations
The following section in the service.yaml
defines the resource allocation for the Cloud Run service instances:
environments:
- id: prod
instances:
resources:
cpu: 1 # Per-instance CPU
memory: 1Gi # Per-insatnce memory
scaling:
maxCount: 3 # Maximum count of instances
minCount: 1 # Minimum count of instances, setting to 1 can avoid cold start
Once updated, follow the Modify deployment manifest to apply the changes.
Observability
Alerting
All alerts from all environments currently go to #alerts-pings-sourcegraph-com.
Metrics
The deployment’s Cloud Run metrics overview page provides basic observability into the service provided out-of-the-box by Cloud Run, such as instance count and resource utilization.
Pings service also pushes GCP Custom Metrics via OpenTelemetry metrics.