Skip to content

Commit

Permalink
Fix curl command to keep Grafana Cloud instance active
Browse files Browse the repository at this point in the history
  • Loading branch information
F21 committed Apr 10, 2024
1 parent 85ab334 commit 8d6ef85
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/keep-grafana-instance-active.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set environment variables from .env
uses: xom9ikk/[email protected]
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Send log to Grafana Cloud
run: >
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TEST_GRAFANA_CLOUD_STACK_IDENTIFIER:$TEST_GRAFANA_CLOUD_TOKEN" -d '{"streams": [{"stream": {"Language": "Curl", "source": "GitHub Actions"},"values": [["'"$(($(date +%s)*1000000000))"'", "Keeping this Grafana instance alive!"]]}]}' https://logs-prod-006.grafana.net/loki/api/v1/push
env:
TEST_GRAFANA_CLOUD_STACK_IDENTIFIER: ${{ secrets.TEST_GRAFANA_CLOUD_STACK_IDENTIFIER }}
TEST_GRAFANA_CLOUD_TOKEN: ${{ secrets.TEST_GRAFANA_CLOUD_TOKEN }}
run: |
curl --fail-with-body -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.TEST_GRAFANA_CLOUD_STACK_LOGS_USER_ID }}:${{ secrets.TEST_GRAFANA_CLOUD_TOKEN }}" -d '{"streams": [{"stream": {"Language": "Curl", "source": "GitHub Actions"},"values": [["'"$(($(date +%s)*1000000000))"'", "Keeping this Grafana instance alive!"]]}]}' https://logs-prod-006.grafana.net/loki/api/v1/push
workflow-keepalive:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8d6ef85

Please sign in to comment.