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

Improve code coverage for uiconv package #3

Merged
merged 2 commits into from
Nov 17, 2020
Merged

Improve code coverage for uiconv package #3

merged 2 commits into from
Nov 17, 2020

Conversation

Ashmita152
Copy link

Signed-off-by: Ashmita Bohara ashmita.bohara152@gmail.com

Which problem is this PR solving?

Increase code coverage for uiconv package

Short description of the changes

Added coverage for two missing if conditions.

Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
Copy link
Owner

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's try to simplify instead

@@ -39,7 +39,7 @@ type Reader struct {
func NewReader(capturedFile string, logger *zap.Logger) (*Reader, error) {
wd, err := os.Getwd()
if err != nil {
return nil, err
return nil, fmt.Errorf("cannot get working directory: %w", err)
}
logger.Sugar().Infof("Current working dir is %s", wd)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a debugging left-over, I don't see wd actually being used, if so it's best to delete L40-44

require.NoError(t, err)
err = os.Chmod(wd, 0000)
require.NoError(t, err)
defer os.Chmod(wd, 0755)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clever, but it's conceivable that the tests might run on a read-only source dir where chmod won't work. If we can get rid of Getwd per my comment above, let's do that instead.

Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
@Ashmita152
Copy link
Author

Thank you @yurishkuro I was also wondering why we were doing that. I have updated the PR removing those.

@codecov-io
Copy link

Codecov Report

Merging #3 (4628dbb) into fix-2556 (784b9d0) will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           fix-2556       #3      +/-   ##
============================================
+ Coverage     95.04%   95.08%   +0.04%     
============================================
  Files           213      213              
  Lines          9496     9492       -4     
============================================
  Hits           9025     9025              
+ Misses          392      390       -2     
+ Partials         79       77       -2     
Impacted Files Coverage Δ
cmd/anonymizer/app/uiconv/reader.go 100.00% <ø> (+10.00%) ⬆️
cmd/query/app/server.go 88.52% <0.00%> (-1.64%) ⬇️
cmd/query/app/static_handler.go 84.82% <0.00%> (+1.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 784b9d0...4628dbb. Read the comment docs.

@yurishkuro yurishkuro merged commit 4add027 into yurishkuro:fix-2556 Nov 17, 2020
yurishkuro added a commit that referenced this pull request Sep 28, 2023
## Which problem is this PR solving?
- Third prototype of "Jaeger-v2"
- Another alternative approach to jaegertracing#3500

## Description of the changes
- Adds a new binary `jaeger-v2` using OTEL Collector framework
- Minimal amount of extensions is included, to mimic what
`jaeger-collector` normally has
- It will combine all previous functions of agent/collector/query in one
binary, but controllable via config file

```
$ go run -tags=ui ./cmd/jaeger-v2 --config ./cmd/jaeger-v2/config.yaml
```

## Roadmap


https://docs.google.com/document/d/1s4_6VgAS7qAVp6iEm5KYvpiGw3h2Ja5T5HpKo29iv00/edit

## Design

* the ingestion and storing of traces will be done via standard
receivers/processors/exporters OTEL Collector components
* the jaeger-query and UI are implemented as `jaeger_query` extension
(already working in this PR)

### Storage
In order to keep the flexibility of mixing & matching storage
implementations, all backends can be configured via `jaeger_storage`
extension (we may need to add `jaeger_metrics_storage` extension in the
future). It might look like this:
```yaml
jaeger_storage:
  memory:  # defines Factory
    memstore:
      max_traces: 100000
  cassandra:
    cassandra_primary:
      servers: [...]
      namespace: jaeger
    cassandra_archive:
      servers: [...]
      namespace: jaeger_archive
```

The `jaeger_query` extension then references specific storage factories
by name:
```yaml
  jaeger_query:
    trace_storage: memstore
    dependencies: something_else
    metrics_store: prometheus_store
```

It's not clear yet if `jaeger_query` extension should simply subsume
`jaeger_storage` extension, because Query is the only one that needs
this _generic_ access to storage, while things like exporters or Kafka
ingester (receiver) always deal with a single implementation (because
OTEL Coll pipeline allows to connect them with each other, which is not
possible with extensions).

## Trade-offs
- This not using OTEL Collector builder `ocb`. That means people won't
be able to assemble a different version of the collector with other
extensions.
- We may want to support `ocb` in the future, as it makes it easier to
write custom in-process exporters for custom storage. It will require
converting all the components into their own modules.

## Next steps

* [x] Get feedback from the community on the approach
* [x] Fully implement all-in-one by wiring receivers / exporters
correctly

## Open Questions
* How can we implement all-in-one equivalent that can be run without any
config file?
* Do we want
[healthcheckextension](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/healthcheckextension/README.md)
to be included by default?
* Investigate startup error `2023-09-23T19:55:46.661-0400 warn
zapgrpc/zapgrpc.go:195 [core] [Channel #2 SubChannel #3] grpc:
addrConn.createTransport failed to connect to {Addr: ":16685",
ServerName: "localhost:16685", }. Err: connection error: desc =
"transport: Error while dialing: dial tcp :16685: connect: connection
refused" {"grpc_log": true}`

---------

Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants