Skip to content

Labels cpp #99

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

Draft
wants to merge 126 commits into
base: pp
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
2326597
for save
u-veles-a Apr 8, 2025
3609e10
don't rebuild sorting index on insert error
cherep58 Apr 9, 2025
55d57f3
added reserve method for QueryableEncodingBimap
cherep58 Apr 10, 2025
1dff133
created performance test for QueryableEncodingBimap
cherep58 Apr 10, 2025
94c65b4
added reserving memory for containers in append_relabeler_series method
cherep58 Apr 10, 2025
164152f
Merge branch 'pp' of https://github.com/deckhouse/prompp into lss_ind…
cherep58 Apr 10, 2025
7878c66
Merge branch 'pp' into lss_index_optimization
cherep58 Apr 10, 2025
d42a8eb
Merge branch 'pp' into lss_index_optimization
cherep58 Apr 10, 2025
14d1578
add write timeout
u-veles-a Apr 10, 2025
764b15a
Merge branch 'pp' into write_timeout
u-veles-a Apr 10, 2025
d91f55a
Merge branch 'lss_index_optimization' into test
u-veles-a Apr 10, 2025
41e4461
for save
u-veles-a Apr 10, 2025
a3f3b8d
Merge branch 'lss_index_optimization' into test
u-veles-a Apr 10, 2025
3e983f6
move merge
u-veles-a Apr 10, 2025
967b738
Merge branch 'pp' into lss_index_optimization
cherep58 Apr 10, 2025
c9f2406
Merge branch 'pp' into lss_index_optimization
cherep58 Apr 11, 2025
79fbd90
Merge branch 'pp' into test
u-veles-a Apr 11, 2025
ddb4fcb
Merge branch 'lss_index_optimization' into test
u-veles-a Apr 11, 2025
a473362
Merge branch 'fix_merge' into test
u-veles-a Apr 11, 2025
f160e73
fix memory
u-veles-a Apr 11, 2025
cf46711
fixed bug with reallocation SharedMemory on non-unique ShredPtr
cherep58 Apr 11, 2025
5ed1bb9
fixed DataStorage::allocation_memory bug in debug build
cherep58 Apr 11, 2025
3ac51df
Merge remote-tracking branch 'origin/shared_memory_bugfix' into test
u-veles-a Apr 11, 2025
45e314c
created performance test for chunk recoder
cherep58 Apr 14, 2025
e9fe596
optimized chunk recoder for constant values chunks
cherep58 Apr 14, 2025
7900f05
optimized BStream::write_bits
cherep58 Apr 14, 2025
1c23b1b
refactored ChunkRecoder
cherep58 Apr 14, 2025
97cb6bb
removed redundant usings
cherep58 Apr 14, 2025
ae679f2
fixed chunks size in performance test
cherep58 Apr 14, 2025
52d0358
fixed compilation error
cherep58 Apr 14, 2025
03c91d3
Merge remote-tracking branch 'origin/recode_chunk_optimization' into …
u-veles-a Apr 15, 2025
eecdbcc
for save
u-veles-a Apr 15, 2025
a9b91c8
created FixedSizeBStream and used it in ChunkRecoder
cherep58 Apr 15, 2025
b133ec9
Merge branch 'recode_chunk_optimization' into test
u-veles-a Apr 15, 2025
4ea54d6
for save
u-veles-a Apr 15, 2025
ae37e8e
for save
u-veles-a Apr 15, 2025
f4cd2d6
for save
u-veles-a Apr 15, 2025
bb7d8cb
for save
u-veles-a Apr 15, 2025
192fe3e
for save
u-veles-a Apr 16, 2025
eaafa59
for save
u-veles-a Apr 16, 2025
9e22222
created QueryableEncodingBimap::copy_added_series for copy label_sets…
cherep58 Apr 18, 2025
6d6235e
for save
u-veles-a Apr 18, 2025
5a17db2
Merge branch 'pp' into test
u-veles-a Apr 18, 2025
736725c
created prompp_primitives_lss_copy_added_series Go-binding
cherep58 Apr 18, 2025
918d050
Merge branch 'pp' into queryable_lss_copy
cherep58 Apr 18, 2025
12e5934
Merge branch 'pp' into test
u-veles-a Apr 18, 2025
0fd2cb4
Merge branch 'pp' into queryable_lss_copy
cherep58 Apr 18, 2025
3d8e2a1
Merge branch 'pp' into test
u-veles-a Apr 21, 2025
e029ba3
Merge branch 'pp' into queryable_lss_copy
cherep58 Apr 21, 2025
346b448
Merge branch 'pp' into queryable_lss_copy
cherep58 Apr 22, 2025
4575b6e
add otlphandler
u-veles-a Apr 22, 2025
2f5e472
add test
u-veles-a Apr 22, 2025
149771e
Merge branch 'otlp_handler' into test
u-veles-a Apr 22, 2025
5869446
Merge branch 'test' into experement
u-veles-a Apr 22, 2025
34c21b7
for save
u-veles-a Apr 23, 2025
b2bf939
for save
u-veles-a Apr 23, 2025
39e65a5
for save
u-veles-a Apr 24, 2025
85a82a7
Merge branch 'pp' into queryable_lss_copy
cherep58 Apr 28, 2025
4dd4739
Merge branch 'pp' into queryable_lss_copy
cherep58 May 6, 2025
9c343f1
add go implementation
u-veles-a May 6, 2025
ae3ca2c
changed logic of prompp_primitives_lss_copy_added_series
cherep58 May 6, 2025
d4dc422
Merge branch 'queryable_lss_copy' into queryable_lss_copy_go
u-veles-a May 6, 2025
d1a0786
for save
u-veles-a May 6, 2025
d1786f2
for save
u-veles-a May 7, 2025
20507e1
Merge branch 'pp' into experement
u-veles-a May 12, 2025
ba61359
fix merge
u-veles-a May 12, 2025
3120b1e
Merge branch 'queryable_lss_copy_go' into experement
u-veles-a May 12, 2025
644cf0c
created entrypoint/label_set module
cherep58 May 13, 2025
d791724
created prompp_label_set_bytes GO-binding
cherep58 May 13, 2025
6ec347f
new labels
u-veles-a May 14, 2025
f4fb034
created prompp_label_set_bytes_with_labels GO-binding
cherep58 May 14, 2025
bc656bc
created prompp_label_set_bytes_without_labels GO-binding
cherep58 May 14, 2025
e224a21
fixed compilation error
cherep58 May 14, 2025
8138c14
created namespace Bytes
cherep58 May 14, 2025
69006f9
fixed compilation errors
cherep58 May 14, 2025
f0060ed
created prompp_create_readonly_lss GO-binding
cherep58 May 14, 2025
de58271
Merge branch 'pp' into readonly_lss_bytes_methods
cherep58 May 15, 2025
8f73b63
rebuild for drop metric name
u-veles-a May 15, 2025
3c6fadc
clearing
u-veles-a May 15, 2025
fb5ee18
Merge branch 'pp' into experement
u-veles-a May 15, 2025
5412078
Merge remote-tracking branch 'origin/create_readonly_lss_binding' int…
u-veles-a May 15, 2025
ea1e190
fix copy
u-veles-a May 15, 2025
61093e9
Merge remote-tracking branch 'origin/readonly_lss_bytes_methods' into…
u-veles-a May 15, 2025
d4d8a17
fix after merge
u-veles-a May 15, 2025
de16b41
rebuild bytes
u-veles-a May 16, 2025
181645d
for save
u-veles-a May 16, 2025
13bf0e1
revert
u-veles-a May 20, 2025
de24757
Merge branch 'pp' into labels_cpp
u-veles-a May 20, 2025
91911e6
fix after merge
u-veles-a May 20, 2025
d991279
Merge branch 'pp' into labels_cpp
u-veles-a Jun 4, 2025
7649069
fix after merge
u-veles-a Jun 4, 2025
447cebb
added reallocations detection for EncodingBimap
cherep58 Jun 5, 2025
499520f
created build_deferred_indexes method
cherep58 Jun 5, 2025
413a72a
improved code coverage for sorting_index
cherep58 Jun 5, 2025
ad10274
add test
u-veles-a Jun 5, 2025
b6994c2
for save
u-veles-a Jun 5, 2025
fc97491
Fix object loose bugs
vporoshok Jun 5, 2025
f942b6d
Merge branch 'fix-gc-leaks' of https://github.com/deckhouse/prompp in…
cherep58 Jun 5, 2025
37aa416
fixed bug with thread_local variable
cherep58 Jun 5, 2025
5ad7d4a
added support for empty readonly_lss in LabelSetBuilder
cherep58 Jun 5, 2025
2afeda9
Merge branch 'pp' of https://github.com/deckhouse/prompp into encodin…
cherep58 Jun 5, 2025
873b1f5
rebuild FindOrEmplaceFromBuilder
u-veles-a Jun 6, 2025
90b882e
Merge branch 'pp' into labels_cpp
u-veles-a Jun 6, 2025
cd5f6ba
for save
u-veles-a Jun 6, 2025
4b09ab7
rebuild builder
u-veles-a Jun 6, 2025
7a884ba
Merge branch 'pp' into labels_cpp
u-veles-a Jun 6, 2025
683f1f9
Merge remote-tracking branch 'origin/encoding_bimap_has_reallocations…
u-veles-a Jun 6, 2025
f1728c6
add hash builder, fix builder
u-veles-a Jun 6, 2025
438d4ce
fix tag
u-veles-a Jun 9, 2025
789ac4c
Merge branch 'pp' into encoding_bimap_has_reallocations
cherep58 Jun 9, 2025
b1e119b
Merge branch 'pp' into encoding_bimap_has_reallocations
cherep58 Jun 9, 2025
0abfb77
for save
u-veles-a Jun 10, 2025
43a3387
Merge branch 'pp' into encoding_bimap_has_reallocations
cherep58 Jun 10, 2025
88799f0
Merge branch 'pp' into encoding_bimap_has_reallocations
cherep58 Jun 10, 2025
b834758
pool
u-veles-a Jun 10, 2025
3908b8e
for save
u-veles-a Jun 18, 2025
efaceb7
for save
u-veles-a Jun 18, 2025
abf3fa6
some fix
u-veles-a Jun 18, 2025
5a93025
for save
u-veles-a Jun 18, 2025
2a97bf4
Merge branch 'pp' into labels_cpp
u-veles-a Jun 18, 2025
d1ecc5b
Merge remote-tracking branch 'origin/encoding_bimap_has_reallocations…
u-veles-a Jun 18, 2025
4b9f0d2
fix test
u-veles-a Jun 18, 2025
1818a6f
fix metrics
u-veles-a Jun 19, 2025
3e35e77
for save
u-veles-a Jun 20, 2025
47341ae
for save
u-veles-a Jun 20, 2025
40e966a
for save
u-veles-a Jun 20, 2025
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
3 changes: 2 additions & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ build:
- builtinassets
- static
- osusergo
- stringlabels
# - stringlabels
- cpplabels
windows:
- builtinassets
- stringlabels
Expand Down
7 changes: 6 additions & 1 deletion cmd/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ func main() {

serverOnlyFlag(a, "storage.head-retention-timeout", "Timeout before inactive heads are shrieked.").
Default("5m").SetValue(&cfg.HeadRetentionTimeout)
// Default("1m").SetValue(&cfg.HeadRetentionTimeout)

// TODO: Remove in Prometheus 3.0.
var b bool
Expand Down Expand Up @@ -717,7 +718,8 @@ func main() {
localStoragePath,
receiver.RotationInfo{
BlockDuration: time.Duration(cfg.tsdb.MinBlockDuration),
Seed: cfgFile.GlobalConfig.ExternalLabels.Hash(),
// BlockDuration: 60 * time.Minute,
Seed: cfgFile.GlobalConfig.ExternalLabels.Hash(),
},
headCatalog,
reloadBlocksTriggerNotifier,
Expand All @@ -727,12 +729,15 @@ func main() {
time.Duration(cfg.HeadRetentionTimeout),
// x3 ScrapeInterval timeout for write block
time.Duration(cfgFile.GlobalConfig.ScrapeInterval*3),
// time.Duration(cfgFile.GlobalConfig.ScrapeInterval*1),
)
if err != nil {
level.Error(logger).Log("msg", "failed to create a receiver", "err", err)
os.Exit(1)
}

labels.Storage.SetReceiver(receiver)

remoteWriterReadyNotifier := ready.NewNotifiableNotifier()
remoteWriter := remotewriter.New(dataDir, headCatalog, clock, remoteWriterReadyNotifier, prometheus.DefaultRegisterer)

Expand Down
33 changes: 18 additions & 15 deletions cmd/prometheus/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ func TestSendAlerts(t *testing.T) {
}{
{
in: []*rules.Alert{
{
Labels: labels.FromStrings("l1", "v1"),
Annotations: labels.FromStrings("a2", "v2"),
ActiveAt: time.Unix(1, 0),
FiredAt: time.Unix(2, 0),
ValidUntil: time.Unix(3, 0),
},
rules.NewAlert(
labels.FromStrings("l1", "v1"),
labels.FromStrings("a2", "v2"),
time.Unix(1, 0),
time.Unix(2, 0),
time.Time{},
time.Unix(3, 0),
),
},
exp: []*notifier.Alert{
{
Expand All @@ -165,13 +166,14 @@ func TestSendAlerts(t *testing.T) {
},
{
in: []*rules.Alert{
{
Labels: labels.FromStrings("l1", "v1"),
Annotations: labels.FromStrings("a2", "v2"),
ActiveAt: time.Unix(1, 0),
FiredAt: time.Unix(2, 0),
ResolvedAt: time.Unix(4, 0),
},
rules.NewAlert(
labels.FromStrings("l1", "v1"),
labels.FromStrings("a2", "v2"),
time.Unix(1, 0),
time.Unix(2, 0),
time.Unix(4, 0),
time.Time{},
),
},
exp: []*notifier.Alert{
{
Expand All @@ -193,7 +195,8 @@ func TestSendAlerts(t *testing.T) {
t.Run(strconv.Itoa(i), func(t *testing.T) {
senderFunc := senderFunc(func(alerts ...*notifier.Alert) {
require.NotEmpty(t, tc.in, "sender called with 0 alert")
require.Equal(t, tc.exp, alerts)
require.True(t, tc.exp[0].Equal(alerts[0]))
// require.Equal(t, tc.exp, alerts)
})
rules.SendAlerts(senderFunc, "http://localhost:9090")(context.TODO(), "up", tc.in...)
})
Expand Down
3 changes: 2 additions & 1 deletion cmd/promtool/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/timestamp"
"github.com/prometheus/prometheus/pp/go/cppbridge"
"github.com/prometheus/prometheus/rules"
"github.com/prometheus/prometheus/storage"
"github.com/prometheus/prometheus/tsdb"
Expand Down Expand Up @@ -69,7 +70,7 @@ func newRuleImporter(logger log.Logger, config ruleImporterConfig, apiClient que

// loadGroups parses groups from a list of recording rule files.
func (importer *ruleImporter) loadGroups(_ context.Context, filenames []string) (errs []error) {
groups, errs := importer.ruleManager.LoadGroups(importer.config.evalInterval, labels.Labels{}, "", nil, filenames...)
groups, errs := importer.ruleManager.LoadGroups(importer.config.evalInterval, cppbridge.Labels{}, "", nil, filenames...) // PP_CHANGES.md: rebuild on cpp
if errs != nil {
return errs
}
Expand Down
7 changes: 4 additions & 3 deletions cmd/promtool/unittest.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

"github.com/prometheus/prometheus/model/histogram"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/pp/go/cppbridge"
"github.com/prometheus/prometheus/promql"
"github.com/prometheus/prometheus/promql/parser"
"github.com/prometheus/prometheus/promql/promqltest"
Expand Down Expand Up @@ -170,7 +171,7 @@ type testGroup struct {
InputSeries []series `yaml:"input_series"`
AlertRuleTests []alertTestCase `yaml:"alert_rule_test,omitempty"`
PromqlExprTests []promqlTestCase `yaml:"promql_expr_test,omitempty"`
ExternalLabels labels.Labels `yaml:"external_labels,omitempty"`
ExternalLabels cppbridge.Labels `yaml:"external_labels,omitempty"` // PP_CHANGES.md: rebuild on cpp
ExternalURL string `yaml:"external_url,omitempty"`
TestGroupName string `yaml:"name,omitempty"`
}
Expand Down Expand Up @@ -314,8 +315,8 @@ func (tg *testGroup) test(evalInterval time.Duration, groupOrderMap map[string]i
for _, a := range ar.ActiveAlerts() {
if a.State == rules.StateFiring {
alerts = append(alerts, labelAndAnnotation{
Labels: a.Labels.Copy(),
Annotations: a.Annotations.Copy(),
Labels: a.Labels().Copy(), // PP_CHANGES.md: rebuild on cpp
Annotations: a.Annotations().Copy(), // PP_CHANGES.md: rebuild on cpp
})
}
}
Expand Down
10 changes: 5 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import (
"gopkg.in/yaml.v2"

"github.com/prometheus/prometheus/discovery"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/relabel"
pp_pkg_config "github.com/prometheus/prometheus/pp-pkg/config" // PP_CHANGES.md: rebuild on cpp
"github.com/prometheus/prometheus/pp/go/cppbridge" // PP_CHANGES.md: rebuild on cpp
"github.com/prometheus/prometheus/storage/remote/azuread"
)

Expand Down Expand Up @@ -84,8 +84,8 @@ func Load(s string, expandExternalLabels bool, logger log.Logger) (*Config, erro
return cfg, nil
}

b := labels.NewScratchBuilder(0)
cfg.GlobalConfig.ExternalLabels.Range(func(v labels.Label) {
b := cppbridge.NewScratchBuilder(cfg.GlobalConfig.ExternalLabels.Len()) // PP_CHANGES.md: rebuild on cpp
cfg.GlobalConfig.ExternalLabels.Range(func(v cppbridge.Label) { // PP_CHANGES.md: rebuild on cpp
newV := os.Expand(v.Value, func(s string) string {
if s == "$" {
return "$"
Expand Down Expand Up @@ -428,7 +428,7 @@ type GlobalConfig struct {
// File to which PromQL queries are logged.
QueryLogFile string `yaml:"query_log_file,omitempty"`
// The labels to add to any timeseries that this Prometheus instance scrapes.
ExternalLabels labels.Labels `yaml:"external_labels,omitempty"`
ExternalLabels cppbridge.Labels `yaml:"external_labels,omitempty"` // PP_CHANGES.md: rebuild on cpp
// An uncompressed response body larger than this many bytes will cause the
// scrape to fail. 0 means no limit.
BodySizeLimit units.Base2Bytes `yaml:"body_size_limit,omitempty"`
Expand Down Expand Up @@ -536,7 +536,7 @@ func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
return err
}

if err := gc.ExternalLabels.Validate(func(l labels.Label) error {
if err := gc.ExternalLabels.Validate(func(l cppbridge.Label) error { // PP_CHANGES.md: rebuild on cpp
if !model.LabelName(l.Name).IsValid() {
return fmt.Errorf("%q is not a valid label name", l.Name)
}
Expand Down
10 changes: 5 additions & 5 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ import (
"github.com/prometheus/prometheus/discovery/vultr"
"github.com/prometheus/prometheus/discovery/xds"
"github.com/prometheus/prometheus/discovery/zookeeper"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/relabel"
"github.com/prometheus/prometheus/pp/go/cppbridge"
"github.com/prometheus/prometheus/util/testutil"
)

Expand Down Expand Up @@ -86,7 +86,7 @@ var expectedConf = &Config{
EvaluationInterval: model.Duration(30 * time.Second),
QueryLogFile: "",

ExternalLabels: labels.FromStrings("foo", "bar", "monitor", "codelab"),
ExternalLabels: cppbridge.FromStrings("foo", "bar", "monitor", "codelab"), // PP_CHANGES.md: rebuild on cpp

BodySizeLimit: globBodySizeLimit,
SampleLimit: globSampleLimit,
Expand Down Expand Up @@ -2082,16 +2082,16 @@ func TestExpandExternalLabels(t *testing.T) {

c, err := LoadFile("testdata/external_labels.good.yml", false, false, log.NewNopLogger())
require.NoError(t, err)
testutil.RequireEqual(t, labels.FromStrings("bar", "foo", "baz", "foo${TEST}bar", "foo", "${TEST}", "qux", "foo$${TEST}", "xyz", "foo$$bar"), c.GlobalConfig.ExternalLabels)
testutil.RequireEqual(t, cppbridge.FromStrings("bar", "foo", "baz", "foo${TEST}bar", "foo", "${TEST}", "qux", "foo$${TEST}", "xyz", "foo$$bar"), c.GlobalConfig.ExternalLabels)

c, err = LoadFile("testdata/external_labels.good.yml", false, true, log.NewNopLogger())
require.NoError(t, err)
testutil.RequireEqual(t, labels.FromStrings("bar", "foo", "baz", "foobar", "foo", "", "qux", "foo${TEST}", "xyz", "foo$bar"), c.GlobalConfig.ExternalLabels)
testutil.RequireEqual(t, cppbridge.FromStrings("bar", "foo", "baz", "foobar", "foo", "", "qux", "foo${TEST}", "xyz", "foo$bar"), c.GlobalConfig.ExternalLabels)

os.Setenv("TEST", "TestValue")
c, err = LoadFile("testdata/external_labels.good.yml", false, true, log.NewNopLogger())
require.NoError(t, err)
testutil.RequireEqual(t, labels.FromStrings("bar", "foo", "baz", "fooTestValuebar", "foo", "TestValue", "qux", "foo${TEST}", "xyz", "foo$bar"), c.GlobalConfig.ExternalLabels)
testutil.RequireEqual(t, cppbridge.FromStrings("bar", "foo", "baz", "fooTestValuebar", "foo", "TestValue", "qux", "foo${TEST}", "xyz", "foo$bar"), c.GlobalConfig.ExternalLabels)
}

func TestAgentMode(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions config/pp_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"gopkg.in/yaml.v2"

"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/relabel"
pp_pkg_config "github.com/prometheus/prometheus/pp-pkg/config"
"github.com/prometheus/prometheus/pp/go/cppbridge"
Expand Down Expand Up @@ -93,7 +92,8 @@ write_relabel_configs:
}

func (s *OpConfigSuite) TestOpDestinationConfigTLSError() {
raw := `destinations:
raw := `protocol: odarix
destinations:
- name: dname
url: https://host.com
remote_timeout: 30s
Expand Down Expand Up @@ -170,7 +170,7 @@ var expectedConf = &config.Config{
EvaluationInterval: model.Duration(30 * time.Second),
QueryLogFile: "",

ExternalLabels: labels.FromStrings("foo", "bar", "monitor", "codelab"),
ExternalLabels: cppbridge.FromMap(map[string]string{"foo": "bar", "monitor": "codelab"}),

BodySizeLimit: 15 * units.MiB,
SampleLimit: 1500,
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0
github.com/Code-Hex/go-generics-cache v1.5.1
github.com/KimMachineGun/automemlimit v0.6.1
github.com/RoaringBitmap/roaring/v2 v2.5.0
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9
github.com/aws/aws-sdk-go v1.53.16
Expand Down Expand Up @@ -108,6 +109,7 @@ require (
github.com/armon/go-metrics v0.4.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.12.0 // indirect
github.com/cilium/ebpf v0.11.0 // indirect
github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
Expand Down Expand Up @@ -176,6 +178,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runtime-spec v1.0.2 // indirect
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ github.com/KimMachineGun/automemlimit v0.6.1/go.mod h1:T7xYht7B8r6AG/AqFcUdc7fzd
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/RoaringBitmap/roaring/v2 v2.5.0 h1:TJ45qCM7D7fIEBwKd9zhoR0/S1egfnSSIzLU1e1eYLY=
github.com/RoaringBitmap/roaring/v2 v2.5.0/go.mod h1:FiJcsfkGje/nZBZgCu0ZxCPOKD/hVXDS2dXi7/eUFE0=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
Expand Down Expand Up @@ -108,6 +110,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA=
github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
Expand Down Expand Up @@ -586,6 +590,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
Expand Down Expand Up @@ -1298,6 +1304,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
Expand Down
2 changes: 1 addition & 1 deletion model/labels/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !stringlabels && !dedupelabels
//go:build !stringlabels && !dedupelabels && !cpplabels

package labels

Expand Down
31 changes: 30 additions & 1 deletion model/labels/labels_common_noncpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func NewLabelsWithLSS(lss *cppbridge.LabelSetSnapshot, id uint32, length uint16)
}

builder := NewScratchBuilder(int(length))
_ = lss.RangeLabelSet(id, func(l cppbridge.Label) error {
_ = lss.RangeLabelSet(id, false, func(l cppbridge.Label) error {
// copy string from cpp memory
builder.Add(strings.Clone(l.Name), strings.Clone(l.Value))

Expand All @@ -24,3 +24,32 @@ func NewLabelsWithLSS(lss *cppbridge.LabelSetSnapshot, id uint32, length uint16)

return builder.Labels()
}

// RenewSnapshot renew ls snapshot. Implementation cpplabels.
func (*Labels) RenewSnapshot() {
// no-op
}

//
// ScratchBuilder
//

// SetSkipCache set the flag to ignore caches. Implementation cpplabels.
func (*ScratchBuilder) SetSkipCache() {
// no-op
}

//
// Storage
//

// Storage global label set storage. Implementation cpplabels.
var Storage = &noopStorage{}

// noopStorage for label set. Implementation cpplabels.
type noopStorage struct{}

// SetReceiver store Receiver. Implementation cpplabels.
func (*noopStorage) SetReceiver(_ any) {
// no-op
}
Loading