Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: otel grpc dependency deprecated issue #17103

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
name: Ensure Go modules synchronicity
if: ${{ needs.changes.outputs.backend == 'true' }}
runs-on: ubuntu-22.04
needs:
- changes
steps:
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
Expand All @@ -62,6 +64,8 @@ jobs:
name: Build & cache Go code
if: ${{ needs.changes.outputs.backend == 'true' }}
runs-on: ubuntu-22.04
needs:
- changes
steps:
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
Expand All @@ -87,6 +91,8 @@ jobs:
name: Lint Go code
if: ${{ needs.changes.outputs.backend == 'true' }}
runs-on: ubuntu-22.04
needs:
- changes
steps:
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
Expand All @@ -106,6 +112,7 @@ jobs:
runs-on: ubuntu-22.04
needs:
- build-go
- changes
env:
GITHUB_TOKEN: ${{ secrets.E2E_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
GITLAB_TOKEN: ${{ secrets.E2E_TEST_GITLAB_TOKEN }}
Expand Down Expand Up @@ -174,6 +181,7 @@ jobs:
runs-on: ubuntu-22.04
needs:
- build-go
- changes
env:
GITHUB_TOKEN: ${{ secrets.E2E_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
GITLAB_TOKEN: ${{ secrets.E2E_TEST_GITLAB_TOKEN }}
Expand Down Expand Up @@ -235,6 +243,8 @@ jobs:
name: Check changes to generated code
if: ${{ needs.changes.outputs.backend == 'true' }}
runs-on: ubuntu-22.04
needs:
- changes
steps:
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
Expand Down Expand Up @@ -284,6 +294,8 @@ jobs:
name: Build, test & lint UI code
if: ${{ needs.changes.outputs.frontend == 'true' }}
runs-on: ubuntu-22.04
needs:
- changes
steps:
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
Expand Down Expand Up @@ -320,6 +332,7 @@ jobs:
needs:
- test-go
- build-ui
- changes
env:
sonar_secret: ${{ secrets.SONAR_TOKEN }}
steps:
Expand Down Expand Up @@ -390,6 +403,7 @@ jobs:
k3s-version: [v1.29.1, v1.28.6, v1.27.10, v1.26.13, v1.25.16]
needs:
- build-go
- changes
env:
GOPATH: /home/runner/go
ARGOCD_FAKE_IN_CLUSTER: "true"
Expand Down Expand Up @@ -499,6 +513,7 @@ jobs:
if: ${{ always() }}
needs:
- test-e2e
- changes
runs-on: ubuntu-22.04
steps:
- run: |
Expand Down
3 changes: 1 addition & 2 deletions cmpserver/apiclient/clientset.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ func NewConnection(address string) (*grpc.ClientConn, error) {
grpc.WithStreamInterceptor(grpc_retry.StreamClientInterceptor(retryOpts...)),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(unaryInterceptors...)),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(MaxGRPCMessageSize), grpc.MaxCallSendMsgSize(MaxGRPCMessageSize)),
grpc.WithUnaryInterceptor(grpc_util.OTELUnaryClientInterceptor()),
grpc.WithStreamInterceptor(grpc_util.OTELStreamClientInterceptor()),
grpc_util.OTELDialOption(),
}

dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
Expand Down
3 changes: 1 addition & 2 deletions cmpserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@ func NewServer(initConstants plugin.CMPServerInitConstants) (*ArgoCDCMPServer, e

serverLog := log.NewEntry(log.StandardLogger())
streamInterceptors := []grpc.StreamServerInterceptor{
otelgrpc.StreamServerInterceptor(),
grpc_logrus.StreamServerInterceptor(serverLog),
grpc_prometheus.StreamServerInterceptor,
grpc_util.PanicLoggerStreamServerInterceptor(serverLog),
}
unaryInterceptors := []grpc.UnaryServerInterceptor{
otelgrpc.UnaryServerInterceptor(),
grpc_logrus.UnaryServerInterceptor(serverLog),
grpc_prometheus.UnaryServerInterceptor,
grpc_util.PanicLoggerUnaryServerInterceptor(serverLog),
}

serverOpts := []grpc.ServerOption{
grpc.StatsHandler(otelgrpc.NewServerHandler()),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(unaryInterceptors...)),
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(streamInterceptors...)),
grpc.MaxRecvMsgSize(apiclient.MaxGRPCMessageSize),
Expand Down
8 changes: 4 additions & 4 deletions docs/operator-manual/notifications/services/alertmanager.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You should turn off "send_resolved" or you will receive unnecessary recovery not
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.alertmanager: |
targets:
Expand All @@ -58,7 +58,7 @@ If your alertmanager has changed the default api, you can customize "apiPath".
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.alertmanager: |
targets:
Expand Down Expand Up @@ -89,7 +89,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.alertmanager: |
targets:
Expand All @@ -110,7 +110,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.alertmanager: |
targets:
Expand Down
23 changes: 18 additions & 5 deletions docs/operator-manual/notifications/services/awssqs.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AWS SQS
# AWS SQS

## Parameters

This notification service is capable of sending simple messages to AWS SQS queue.
This notification service is capable of sending simple messages to AWS SQS queue.

* `queue` - name of the queue you are intending to send messages to. Can be overridden with target destination annotation.
* `region` - region of the sqs queue can be provided via env variable AWS_DEFAULT_REGION
Expand Down Expand Up @@ -30,7 +30,7 @@ metadata:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.awssqs: |
region: "us-east-2"
Expand Down Expand Up @@ -63,7 +63,7 @@ stringData:

### Minimal configuration using AWS Env variables

Ensure following list of environment variables are injected via OIDC, or other method. And assuming SQS is local to the account.
Ensure the following list of environment variables are injected via OIDC, or another method. And assuming SQS is local to the account.
You may skip usage of secret for sensitive data and omit other parameters. (Setting parameters via ConfigMap takes precedent.)

Variables:
Expand All @@ -89,7 +89,7 @@ metadata:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.awssqs: |
queue: "myqueue"
Expand All @@ -104,3 +104,16 @@ data:
- oncePer: obj.metadata.annotations["generation"]

```

## FIFO SQS Queues

FIFO queues require a [MessageGroupId](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html#SQS-SendMessage-request-MessageGroupId) to be sent along with every message, every message with a matching MessageGroupId will be processed one by one in order.

To send to a FIFO SQS Queue you must include a `messageGroupId` in the template such as in the example below:

```yaml
template.deployment-ready: |
message: |
Deployment {{.obj.metadata.name}} is ready!
messageGroupId: {{.obj.metadata.name}}-deployment
```
6 changes: 3 additions & 3 deletions docs/operator-manual/notifications/services/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following snippet contains sample Gmail service configuration:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.email.gmail: |
username: $email-username
Expand All @@ -36,7 +36,7 @@ Without authentication:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.email.example: |
host: smtp.example.com
Expand All @@ -52,7 +52,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
template.app-sync-succeeded: |
email:
Expand Down
3 changes: 2 additions & 1 deletion docs/operator-manual/notifications/services/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ in `argocd-notifications-cm` ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.github: |
appID: <app-id>
Expand Down Expand Up @@ -76,6 +76,7 @@ template.app-deployed: |
logURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
requiredContexts: []
autoMerge: true
transientEnvironment: false
pullRequestComment:
content: |
Application {{.app.metadata.name}} is now running new version of deployments manifests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The Google Chat notification service send message notifications to a google chat
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.googlechat: |
webhooks:
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/notifications/services/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Available parameters :
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.grafana: |
apiUrl: https://grafana.example.com/api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in `argocd-notifications-cm` ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.mattermost: |
apiURL: <api-url>
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/notifications/services/newrelic.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.newrelic: |
apiURL: <api-url>
Expand Down
5 changes: 3 additions & 2 deletions docs/operator-manual/notifications/services/opsgenie.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ To be able to send notifications with argocd-notifications you have to create an
9. Make sure the checkboxes for "Create and Update Access" and "enable" are selected, disable the other checkboxes to remove unnecessary permissions
10. Click "Safe Integration" at the bottom
11. Check your browser for the correct server apiURL. If it is "app.opsgenie.com" then use the US/international api url `api.opsgenie.com` in the next step, otherwise use `api.eu.opsgenie.com` (European API).
12. You are finished with configuring opsgenie. Now you need to configure argocd-notifications. Use the apiUrl, the team name and the apiKey to configure the Opsgenie integration in the `argocd-notifications-secret` secret.
12. You are finished with configuring Opsgenie. Now you need to configure argocd-notifications. Use the apiUrl, the team name and the apiKey to configure the Opsgenie integration in the `argocd-notifications-secret` secret.


```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.opsgenie: |
apiUrl: <api-url>
Expand Down
4 changes: 2 additions & 2 deletions docs/operator-manual/notifications/services/pagerduty.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.pagerduty: |
token: $pagerdutyToken
Expand All @@ -41,7 +41,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
template.rollout-aborted: |
message: Rollout {{.rollout.metadata.name}} is aborted.
Expand Down
4 changes: 2 additions & 2 deletions docs/operator-manual/notifications/services/pagerduty_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.pagerdutyv2: |
serviceKeys:
Expand All @@ -43,7 +43,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
template.rollout-aborted: |
message: Rollout {{.rollout.metadata.name}} is aborted.
Expand Down
4 changes: 2 additions & 2 deletions docs/operator-manual/notifications/services/pushover.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Pushover

1. Create an app at [pushover.net](https://pushover.net/apps/build).
2. Store the API key in `<secret-name>` Secret and define the secret name in `<config-map-name>` ConfigMap:
2. Store the API key in `<secret-name>` Secret and define the secret name in `argocd-notifications-cm` ConfigMap:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.pushover: |
token: $pushover-token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.rocketchat: |
email: $rocketchat-email
Expand Down
3 changes: 2 additions & 1 deletion docs/operator-manual/notifications/services/slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The Slack notification service configuration includes following settings:
| `signingSecret` | False | `string` | | `8f742231b10e8888abcd99yyyzzz85a5` |
| `token` | **True** | `string` | The app's OAuth access token. | `xoxb-1234567890-1234567890123-5n38u5ed63fgzqlvuyxvxcx6` |
| `username` | False | `string` | The app username. | `argocd` |
| `disableUnfurl` | False | `bool` | Disable slack unfurling links in messages | `true` |

## Configuration

Expand Down Expand Up @@ -48,7 +49,7 @@ The Slack notification service configuration includes following settings:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.slack: |
token: $slack-token
Expand Down
2 changes: 1 addition & 1 deletion docs/operator-manual/notifications/services/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Teams notification service send message notifications using Teams bot and re
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.teams: |
recipientUrls:
Expand Down
Loading
Loading