Skip to content
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

Add errors to datadog traces #10

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## 1.x.x

### Breaking Changes:
- Makes use of internal Kroo libraries and as such is no longer usable out side of internal Kroo code bases
- Requires Clojure 11.1
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,17 @@ A libary to process events making a number of choices

Allows for multiple processors configured in different ways.

Now defers to the config-agnostic KSB version of this library, providing a backwards-compatible wrapper that uses configurati.

## Install

Add the following to your `project.clj` file:

```clj
[b-social/event-processor "0.1.0"]
[b-social/event-processor "<VERSION>"]
```

## Documentation

* [API Docs](http://b-social.github.io/event-processor)

## Usage

FIXME
Ensure that you're set up to access our internal maven libraries (as of 1.x.x this library is no longer usable outside of Kroo codebases due to internal dependencies).

## License

Expand Down
14 changes: 6 additions & 8 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@
:license {:name "The MIT License"
:url "https://opensource.org/licenses/MIT"}

:dependencies [[org.clojure/clojure "1.10.0"]
[com.stuartsierra/component "1.0.0"]
:dependencies [[org.clojure/clojure "1.11.1"]
[io.logicblocks/configurati "0.5.2"]
[cambium/cambium.core "0.9.3"]
[cambium/cambium.codec-cheshire "0.9.3"]
[org.clojure/java.jdbc "0.7.11"]
[org.clj-commons/claypoole "1.2.2"]
[com.datadoghq/dd-trace-ot "1.17.0"]]
[com.kroo.service-base/event-processor "0.105"]]

:plugins [[lein-cloverage "1.1.2"]
[lein-shell "0.5.0"]
Expand Down Expand Up @@ -48,7 +43,10 @@
:doc-paths ["docs"]
:source-uri "https://github.com/b-social/event-processor/blob/{version}/{filepath}#L{line}"}

:repositories [["public-github" {:url "git://github.com"}]]
:repositories [["public-github" {:url "git://github.com"}]
["kroo-github" {:url "https://maven.pkg.github.com/b-social/REPOSITORY"
:username :env/GITHUB_ACTOR
:password :env/GITHUB_TOKEN}]]

:deploy-repositories [["github" {:url "https://maven.pkg.github.com/b-social/event-processor"
:username :env/GITHUB_ACTOR
Expand Down
131 changes: 0 additions & 131 deletions src/event_processor/processor/component.clj

This file was deleted.

73 changes: 0 additions & 73 deletions src/event_processor/processor/locking/locks.clj

This file was deleted.

17 changes: 4 additions & 13 deletions src/event_processor/processor/protocols.clj
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
(ns event-processor.processor.protocols)
(ns event-processor.processor.protocols
(:require [com.kroo.service-base.event-processor.protocols :as p]))

(defprotocol EventProcessor
"A handler that is called at certain points in an events lifecycle.
The passed processor contains all the configured dependencies."
:extend-via-metadata true
(get-unprocessed-events [this processor]
"A callback to get all un-processed events")
(group-unprocessed-events-by [this processor event]
"Callback to get the key for which to process an event")
(handle-event [this processor event event-context]
"A callback for processing an event")
(on-processing-complete [this processor event event-context]
"A callback for when an event has finished processing"))
;; re-exporting to ease transition, protocol is the same
(def EventProcessor p/EventProcessor)
46 changes: 22 additions & 24 deletions src/event_processor/processor/system.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
[clojure.string :as str]
[com.stuartsierra.component :as component]
[configurati.core :as conf]
[event-processor.processor.component :as two-stage]
[event-processor.processor.configuration :as processor-configuration]
[event-processor.utils.logging :as log]))
[com.kroo.service-base.event-processor :as two-stage]
[event-processor.processor.configuration :as processor-configuration]))

(defn- ->keyword
[parts]
Expand Down Expand Up @@ -76,24 +75,23 @@
(or processor (->keyword [processor-name "-processor"]))
processing-enabled?
(get configuration-overrides processing-enabled true)]
(log/log-info
{processing-enabled processing-enabled?}
"Processing enabled?")
(when processing-enabled?
(component/system-map
processor-configuration
(conf/resolve
(processor configuration-overrides
(processor-configuration/processor-configuration
configuration-prefix
processor-identifier
configuration-overrides)))

processor
(component/using
(two-stage/new-processor processor-identifier)
(merge
{:configuration processor-configuration
:database database
:event-handler event-handler}
additional-dependencies))))))
(component/system-map
processor-configuration
(assoc (conf/resolve
(processor configuration-overrides
(processor-configuration/processor-configuration
configuration-prefix
processor-identifier
configuration-overrides)))
:enabled? processing-enabled?
:processor-id processor-identifier)


processor
(component/using
(two-stage/map->EventProcessor {})
(merge
{:configuration processor-configuration
:database database
:event-handler event-handler}
additional-dependencies)))))
47 changes: 0 additions & 47 deletions src/event_processor/utils/logging.clj

This file was deleted.