libhoney 2.2.0.pre.dev → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/release.yml +3 -1
- data/.github/workflows/add-to-project-v2.yml +1 -1
- data/CHANGELOG.md +21 -0
- data/DEVELOPMENT.md +31 -0
- data/README.md +2 -0
- data/lib/libhoney/client.rb +4 -3
- data/lib/libhoney/version.rb +1 -1
- data/lib/libhoney.rb +22 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fded3aff49e82adca1103c69e01bfcf6c25096f381b35b8d4506de69743a03a
|
4
|
+
data.tar.gz: fda0eecd31f9c23d206ad5eb85bd9a46979f2489fa2b0f6872551c3b79e898df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a60d2c1de54c08e418cd2af91dd61d3656567cf6597c7e0ae7dbb812f4d94009d35f6de83f1c0f83cc0944034a40ee777483cc3aa9994a9c5893e42334d6df79
|
7
|
+
data.tar.gz: 1f2ab384a92d6125c69a93b8ef537b7ce80139b68e891ff22b1ad10f7c1f5ed754cb8bfd1df7359793b801bde2c0b7342a56ffc7c6f7ca6959e1180090d50700
|
data/.github/CODEOWNERS
CHANGED
data/.github/release.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## [2.3.0] - 2024-03-07
|
2
|
+
|
3
|
+
### Enhancements
|
4
|
+
|
5
|
+
- feat: support classic-flavored ingest keys (#138) | [robbkidd](https://github.com/robbkidd)
|
6
|
+
|
7
|
+
### Maintenance
|
8
|
+
|
9
|
+
- maint: add labels to release.yml for auto-generated grouping (#139) | [JamieDanielson](https://github.com/JamieDanielson)
|
10
|
+
- maint: update codeowners to pipeline-team (#137) | [JamieDanielson](https://github.com/JamieDanielson)
|
11
|
+
- maint: update codeowners to pipeline (#136) | [JamieDanielson](https://github.com/JamieDanielson)
|
12
|
+
- docs: add development.md (#135) | [vreynolds](https://github.com/vreynolds)
|
13
|
+
- chore: update dependabot title (#134) | [pkanal](https://github.com/pkanal)
|
14
|
+
- ci: update validate PR title workflow (#133) | [pkanal](https://github.com/pkanal)
|
15
|
+
- ci: validate PR title (#132) | [pkanal](https://github.com/pkanal)
|
16
|
+
- maint: add wiki tracing example (#131) | [vreynolds](https://github.com/vreynolds)
|
17
|
+
- maint: delete workflows for old board (#130) | [vreynolds](https://github.com/vreynolds)
|
18
|
+
- maint: add release file (#129) | [vreynolds](https://github.com/vreynolds)
|
19
|
+
- maint: add new project workflow (#128) | [vreynolds](https://github.com/vreynolds)
|
20
|
+
- maint: add ruby 3.1 to CI matrix (#127) | [vreynolds](https://github.com/vreynolds)
|
21
|
+
|
1
22
|
## [2.2.0] - 2022-04-14
|
2
23
|
|
3
24
|
### Added
|
data/DEVELOPMENT.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Local Development
|
2
|
+
|
3
|
+
## Requirements
|
4
|
+
|
5
|
+
Ruby: https://www.ruby-lang.org/en/documentation/installation/
|
6
|
+
|
7
|
+
Rake:
|
8
|
+
|
9
|
+
```shell
|
10
|
+
gem install rake
|
11
|
+
```
|
12
|
+
|
13
|
+
## Install dependencies
|
14
|
+
|
15
|
+
```shell
|
16
|
+
bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
## Run Tests
|
20
|
+
|
21
|
+
To run all tests:
|
22
|
+
|
23
|
+
```shell
|
24
|
+
bundle exec rake test
|
25
|
+
```
|
26
|
+
|
27
|
+
To run individual tests:
|
28
|
+
|
29
|
+
```shell
|
30
|
+
bundle exec rake test TEST=test/log_transmission_test.rb
|
31
|
+
```
|
data/README.md
CHANGED
@@ -15,6 +15,8 @@ For tracing support and automatic instrumentation of Rails, Sinatra, Rack, Activ
|
|
15
15
|
|
16
16
|
## Contributions
|
17
17
|
|
18
|
+
See [DEVELOPMENT.md](./DEVELOPMENT.md)
|
19
|
+
|
18
20
|
Features, bug fixes and other changes to `libhoney` are gladly accepted. Please
|
19
21
|
open issues or a pull request with your change. Remember to add your name to the
|
20
22
|
CONTRIBUTORS file!
|
data/lib/libhoney/client.rb
CHANGED
@@ -278,7 +278,7 @@ module Libhoney
|
|
278
278
|
end
|
279
279
|
|
280
280
|
def get_dataset(dataset, write_key)
|
281
|
-
return dataset if
|
281
|
+
return dataset if classic_api_key?(write_key)
|
282
282
|
|
283
283
|
if dataset.nil? || dataset.empty?
|
284
284
|
warn "nil or empty dataset - sending data to '#{DEFAULT_DATASET}'"
|
@@ -292,8 +292,9 @@ module Libhoney
|
|
292
292
|
dataset
|
293
293
|
end
|
294
294
|
|
295
|
-
|
296
|
-
|
295
|
+
# @api private
|
296
|
+
def classic_api_key?(write_key)
|
297
|
+
Libhoney.classic_api_key?(write_key)
|
297
298
|
end
|
298
299
|
end
|
299
300
|
end
|
data/lib/libhoney/version.rb
CHANGED
data/lib/libhoney.rb
CHANGED
@@ -6,3 +6,25 @@ require 'libhoney/version'
|
|
6
6
|
require 'libhoney/builder'
|
7
7
|
require 'libhoney/response'
|
8
8
|
require 'libhoney/transmission'
|
9
|
+
|
10
|
+
module Libhoney
|
11
|
+
# Determines if the given string is a Honeycomb API key for Classic environments.
|
12
|
+
#
|
13
|
+
# @param api_key [String] the string to check
|
14
|
+
# @return [Boolean] true if the string is nil or a classic API key, false otherwise
|
15
|
+
def self.classic_api_key?(api_key)
|
16
|
+
api_key.nil? || # default to classic behavior if no API key is provided
|
17
|
+
CLASSIC_KEY_ORIGINAL_FLAVOR.match?(api_key) ||
|
18
|
+
CLASSIC_KEY_V3_INGEST.match?(api_key)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Private constant for key format detection.
|
22
|
+
# @api private
|
23
|
+
CLASSIC_KEY_ORIGINAL_FLAVOR = Regexp.new(/\A[[:alnum:]]{32}\z/)
|
24
|
+
private_constant :CLASSIC_KEY_ORIGINAL_FLAVOR
|
25
|
+
|
26
|
+
# Private constant for key format detection.
|
27
|
+
# @api private
|
28
|
+
CLASSIC_KEY_V3_INGEST = Regexp.new(/\Ahc[a-z]ic_[[:alnum:]]{58}\z/)
|
29
|
+
private_constant :CLASSIC_KEY_V3_INGEST
|
30
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libhoney
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Honeycomb.io Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|
@@ -268,6 +268,7 @@ files:
|
|
268
268
|
- CODE_OF_CONDUCT.md
|
269
269
|
- CONTRIBUTING.md
|
270
270
|
- CONTRIBUTORS
|
271
|
+
- DEVELOPMENT.md
|
271
272
|
- Gemfile
|
272
273
|
- LICENSE
|
273
274
|
- NOTICE
|
@@ -318,11 +319,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
318
319
|
version: 2.4.0
|
319
320
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
320
321
|
requirements:
|
321
|
-
- - "
|
322
|
+
- - ">="
|
322
323
|
- !ruby/object:Gem::Version
|
323
|
-
version:
|
324
|
+
version: '0'
|
324
325
|
requirements: []
|
325
|
-
rubygems_version: 3.
|
326
|
+
rubygems_version: 3.4.19
|
326
327
|
signing_key:
|
327
328
|
specification_version: 4
|
328
329
|
summary: send data to Honeycomb
|