Skip to content

Commit 4ed72bd

Browse files
authored
add storage full error to xextension/storage (#12925)
#### Description This adds an error for when the storage extension runs out of space. Extensions can return this error when it's not possible to store data because the maximum allowable/possible space has been reached. #### Link to tracking issue Fixes #12634 #### Testing I have been working on the filestorage extension and have a draft PR that uses this error: open-telemetry/opentelemetry-collector-contrib#39667
1 parent 8862cb1 commit 4ed72bd

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.chloggen/storage-full-error.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: xextension/storage
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: ErrStorageFull error added to xextension/storage contract
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [12925]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [api]

extension/xextension/storage/storage.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package storage // import "go.opentelemetry.io/collector/extension/xextension/st
55

66
import (
77
"context"
8+
"errors"
89

910
"go.opentelemetry.io/collector/component"
1011
"go.opentelemetry.io/collector/extension"
@@ -91,3 +92,5 @@ func DeleteOperation(key string) *Operation {
9192
Type: Delete,
9293
}
9394
}
95+
96+
var ErrStorageFull = errors.New("the storage extension has run out of available space")

0 commit comments

Comments
 (0)