-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
605 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"chainlink": minor | ||
--- | ||
|
||
#bugfix Update Log.Level and MaxSize configs description in the docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,27 +16,48 @@ jobs: | |
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id | ||
actions: write | ||
contents: read | ||
env: | ||
REPO: ${{ github.repository }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
||
- name: Cleanup Branch Caches | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
REPO=${{ github.repository }} | ||
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge | ||
- name: Setup gh-actions-cache extension | ||
run: gh extension install actions/gh-actions-cache | ||
|
||
echo "Fetching list of cache key" | ||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) | ||
- name: Retrieve Trunk SHA | ||
id: get-sha | ||
run: | | ||
SHA=$(gh pr view -R $REPO $PR_NUMBER --json mergeCommit --jq .mergeCommit.oid) | ||
echo "sha=$SHA" >> $GITHUB_OUTPUT | ||
## Setting this to not fail the workflow while deleting cache keys. | ||
- name: Cleanup Caches | ||
env: | ||
TRUNK_SHA: ${{ steps.get-sha.outputs.sha }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set +e | ||
echo "Deleting caches..." | ||
for cacheKey in $cacheKeysForPR | ||
do | ||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | ||
PR_BRANCH=refs/pull/$PR_NUMBER/merge | ||
echo "Fetching list of cache keys for the PR branch ($PR_BRANCH)" | ||
PR_CACHE_KEYS=$(gh actions-cache list -R $REPO -B $PR_BRANCH | cut -f 1) | ||
echo "Deleting caches for PR branch ($PR_BRANCH)..." | ||
for CACHE_KEY in $PR_CACHE_KEYS; do | ||
gh actions-cache delete $CACHE_KEY -R $REPO -B $PR_BRANCH --confirm | ||
done | ||
if [[ -n "$TRUNK_SHA" ]]; then | ||
echo "Found corresponding merge commit $TRUNK_SHA" | ||
QUEUE_BRANCH="gh-readonly-queue/develop/pr-${PR_NUMBER}-${TRUNK_SHA}" | ||
echo "Fetching list of cache keys for the merge queue branch ($QUEUE_BRANCH)" | ||
QUEUE_CACHE_KEYS=$(gh actions-cache list -R $REPO -B $QUEUE_BRANCH | cut -f 1) | ||
echo "Deleting caches for merge queue branch ($QUEUE_BRANCH)..." | ||
for CACHE_KEY in $QUEUE_CACHE_KEYS; do | ||
gh actions-cache delete $CACHE_KEY -R $REPO -B $QUEUE_BRANCH --confirm | ||
done | ||
fi | ||
echo "Done" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,38 @@ | ||
package compute | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"go.opentelemetry.io/otel/metric" | ||
|
||
"github.com/smartcontractkit/chainlink-common/pkg/beholder" | ||
"github.com/smartcontractkit/chainlink-common/pkg/metrics" | ||
|
||
localMonitoring "github.com/smartcontractkit/chainlink/v2/core/monitoring" | ||
) | ||
|
||
const timestampKey = "computeTimestamp" | ||
|
||
type computeMetricsLabeler struct { | ||
metrics.Labeler | ||
computeHTTPRequestCounter metric.Int64Counter | ||
} | ||
|
||
func newComputeMetricsLabeler(l metrics.Labeler) (*computeMetricsLabeler, error) { | ||
computeHTTPRequestCounter, err := beholder.GetMeter().Int64Counter("capabilities_compute_http_request_count") | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to register compute http request counter: %w", err) | ||
} | ||
|
||
return &computeMetricsLabeler{Labeler: l, computeHTTPRequestCounter: computeHTTPRequestCounter}, nil | ||
} | ||
|
||
func (c *computeMetricsLabeler) with(keyValues ...string) *computeMetricsLabeler { | ||
return &computeMetricsLabeler{c.With(keyValues...), c.computeHTTPRequestCounter} | ||
} | ||
|
||
func (c *computeMetricsLabeler) incrementHTTPRequestCounter(ctx context.Context) { | ||
otelLabels := localMonitoring.KvMapToOtelAttributes(c.Labels) | ||
c.computeHTTPRequestCounter.Add(ctx, 1, metric.WithAttributes(otelLabels...)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.