ecs-logging 0.2.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1915b7e8e0bb7478ec5f730ab0362392f09f820ac12d79fd3474f87e207a05a3
4
- data.tar.gz: e4100217b49ec650f2594176976f8f452a64cf26e7b807b99e1baca6fc47cbb0
3
+ metadata.gz: 3a81f133f4afd81becd74097f04605c64aa775ba3d608b098796aa529e7cd3b5
4
+ data.tar.gz: 1956240ae662101b9bb8ad9921eae6d7df22b4d203f105c70b88bd509b2f308a
5
5
  SHA512:
6
- metadata.gz: 27e97608af308c9efed7211c0a50cef1f9832a6aa57ac4eb4c80d01d25d9b3cd28b3a01fb73cbbb88ee9a314ffa5c5cc45bdd8eddd645d7752741f21d10f43ed
7
- data.tar.gz: 15abf89d399284aaad1517508358a8a5b34da28bdf1b442164be2f905a790eaa44b49978c7ab7285024e50b3c035e9f155b846da6acb85e5dea6b39a9042042e
6
+ metadata.gz: 69401d9254d264f341cce477be077d6d2dd7955b012daef75bd7517d91a5d25c46137f274445b86ec20be0004c3e08462f52dc1f92c5d07abecac48d475c7a21
7
+ data.tar.gz: 5ceb443448b0bd5e75ed5f6acce0177f3916dffd31fe321031c380acb83ed4de8a2f239de7b815564214c08a8b14902e1ae1a28ca7b4167bb3acadf914018588
data/CHANGELOG.asciidoc CHANGED
@@ -32,6 +32,16 @@ endif::[]
32
32
  ==== Unreleased
33
33
  ////
34
34
 
35
+ [[release-notes-1.x]]
36
+ === ECS logging Ruby 1.x
37
+
38
+ [[release-notes-1.0.0]]
39
+ ==== 1.0.0 (2021-02-09)
40
+
41
+ ===== Added
42
+
43
+ - Add tracing IDs from Elastic APM if running alongside {pull}14[#14]
44
+
35
45
  [[release-notes-0.x]]
36
46
  === ECS logging Ruby 0.x
37
47
 
data/Gemfile CHANGED
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  source "https://rubygems.org"
2
19
 
3
20
  gemspec
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Jenkins](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-ruby/ecs-logging-ruby-mbp/master)](https://apm-ci.elastic.co/job/apm-agent-ruby/job/ecs-logging-ruby-mbp/job/master/) [![Gem](https://img.shields.io/gem/v/ecs-logging.svg)](https://rubygems.org/gems/ecs-logging)
4
4
 
5
5
  This set of libraries allows you to transform your application logs to structured logs that comply with the [Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html).
6
- In combination with [filebeat](https://www.elastic.co/products/beats/filebeat) you can send your logs directly to Elasticsearch and leverage [Kibana's Logs UI](https://www.elastic.co/guide/en/infrastructure/guide/current/logs-ui-overview.html) to inspect all logs in one single place.
6
+ In combination with [Filebeat](https://www.elastic.co/products/beats/filebeat), send your logs directly to Elasticsearch and leverage [Kibana's Logs app](https://www.elastic.co/guide/en/observability/current/monitor-logs.html) to inspect all of your logs in a single place.
7
7
  See [ecs-logging](https://github.com/elastic/ecs-logging) for other ECS logging libraries and more resources about ECS & logging.
8
8
 
9
9
  ---
data/bin/dev CHANGED
@@ -1,4 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ # Licensed to Elasticsearch B.V. under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with
5
+ # this work for additional information regarding copyright
6
+ # ownership. Elasticsearch B.V. licenses this file to you under
7
+ # the Apache License, Version 2.0 (the "License"); you may
8
+ # not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
2
20
  # frozen_string_literal: true
3
21
 
4
22
  require 'optparse'
data/docs/setup.asciidoc CHANGED
@@ -71,7 +71,7 @@ Logs the following:
71
71
  ----
72
72
  {
73
73
  "@timestamp":"2020-11-24T13:32:21.331Z",
74
- "log.level":"ERROR",
74
+ "log.level":"INFO",
75
75
  "message":"oh no!",
76
76
  "ecs.version":"1.4.0",
77
77
  "labels":{"my_label":"value"},
@@ -43,6 +43,12 @@ module EcsLogging
43
43
  end
44
44
  end
45
45
 
46
+ if apm_agent_present_and_running?
47
+ extras[:"transaction.id"] = ElasticAPM.current_transaction&.id
48
+ extras[:"trace.id"] = ElasticAPM.current_transaction&.trace_id
49
+ extras[:"span.id"] = ElasticAPM.current_span&.id
50
+ end
51
+
46
52
  @logdev.write(
47
53
  format_message(
48
54
  format_severity(severity),
@@ -87,5 +93,11 @@ module EcsLogging
87
93
  def format_message(severity, datetime, progname, msg, **extras)
88
94
  formatter.call(severity, datetime, progname, msg, **extras)
89
95
  end
96
+
97
+ def apm_agent_present_and_running?
98
+ return false unless defined?(::ElasticAPM)
99
+
100
+ ElasticAPM.running?
101
+ end
90
102
  end
91
103
  end
@@ -18,5 +18,5 @@
18
18
  # frozen_string_literal: true
19
19
 
20
20
  module EcsLogging
21
- VERSION = "0.2.1"
21
+ VERSION = "1.0.0"
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecs-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-13 00:00:00.000000000 Z
11
+ date: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Write a longer description or delete this line.
14
14
  email: